playbook_ui 14.1.0.pre.alpha.PA1477timestampkit3536 → 14.1.0.pre.alpha.PBNTR417addcolorsupdatedefaultcolor3608

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) 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.scss +3 -3
  4. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
  5. data/app/pb_kits/playbook/pb_badge/_badge.scss +9 -0
  6. data/app/pb_kits/playbook/pb_badge/_badge.tsx +8 -3
  7. data/app/pb_kits/playbook/pb_badge/badge.rb +1 -1
  8. data/app/pb_kits/playbook/pb_badge/badge.test.js +17 -11
  9. data/app/pb_kits/playbook/pb_badge/docs/_badge_notification.html.erb +13 -0
  10. data/app/pb_kits/playbook/pb_badge/docs/_badge_notification.jsx +31 -12
  11. data/app/pb_kits/playbook/pb_button/_button.tsx +4 -1
  12. data/app/pb_kits/playbook/pb_button/button.html.erb +1 -1
  13. data/app/pb_kits/playbook/pb_button/button.rb +4 -0
  14. data/app/pb_kits/playbook/pb_date_time/dateTime.test.js +2 -2
  15. data/app/pb_kits/playbook/pb_dialog/_close_icon.tsx +5 -1
  16. data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +3 -1
  17. data/app/pb_kits/playbook/pb_dialog/dialog.test.jsx +20 -1
  18. data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +1 -1
  19. data/app/pb_kits/playbook/pb_dialog/dialog_header.rb +4 -0
  20. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default.jsx +1 -5
  21. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.jsx +46 -0
  22. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +1 -0
  23. data/app/pb_kits/playbook/pb_dialog/docs/index.js +1 -0
  24. data/app/pb_kits/playbook/pb_filter/filter.rb +1 -1
  25. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -0
  26. data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +287 -47
  27. data/app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx +5 -5
  28. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +8 -4
  29. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.html.erb +117 -0
  30. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.jsx +227 -0
  31. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.md +1 -0
  32. data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +4 -2
  33. data/app/pb_kits/playbook/pb_form_pill/docs/index.js +1 -0
  34. data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +4 -4
  35. data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +6 -2
  36. data/app/pb_kits/playbook/pb_gantt_chart/_gantt_chart.scss +3 -0
  37. data/app/pb_kits/playbook/pb_gantt_chart/_gantt_chart.tsx +72 -0
  38. data/app/pb_kits/playbook/pb_gantt_chart/docs/_gantt_chart_default.jsx +53 -0
  39. data/app/pb_kits/playbook/pb_gantt_chart/docs/example.yml +7 -0
  40. data/app/pb_kits/playbook/pb_gantt_chart/docs/index.js +1 -0
  41. data/app/pb_kits/playbook/pb_gantt_chart/gantt_chart.test.jsx +19 -0
  42. data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -1
  43. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +5 -3
  44. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color.html.erb +72 -0
  45. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color.jsx +91 -0
  46. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color_rails.md +1 -0
  47. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color_react.md +1 -0
  48. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +2 -0
  49. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -0
  50. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +4 -0
  51. data/app/pb_kits/playbook/pb_pagination/_pagination.scss +49 -13
  52. data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +164 -0
  53. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default.jsx +19 -0
  54. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default_react.md +1 -0
  55. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change.jsx +62 -0
  56. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change_react.md +1 -0
  57. data/app/pb_kits/playbook/pb_pagination/docs/data.js +23 -0
  58. data/app/pb_kits/playbook/pb_pagination/docs/example.yml +3 -1
  59. data/app/pb_kits/playbook/pb_pagination/docs/index.js +2 -0
  60. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +0 -7
  61. data/app/pb_kits/playbook/pb_popover/_popover.tsx +10 -5
  62. data/app/pb_kits/playbook/pb_rich_text_editor/_previewer_mixin.scss +132 -0
  63. data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss +50 -76
  64. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_preview.jsx +73 -0
  65. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +1 -0
  66. data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +2 -1
  67. data/app/pb_kits/playbook/pb_star_rating/index.js +78 -41
  68. data/app/pb_kits/playbook/pb_star_rating/star_rating.html.erb +4 -2
  69. data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +17 -0
  70. data/app/pb_kits/playbook/pb_star_rating/subcomponents/_star_rating_display.tsx +0 -2
  71. data/app/pb_kits/playbook/pb_star_rating/subcomponents/_star_rating_interactive.tsx +0 -1
  72. data/app/pb_kits/playbook/pb_time/_time.tsx +12 -8
  73. data/app/pb_kits/playbook/pb_time/time.html.erb +3 -3
  74. data/app/pb_kits/playbook/pb_time/time.rb +4 -0
  75. data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +2 -37
  76. data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +18 -2
  77. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +4 -0
  78. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +26 -18
  79. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color.html.erb +31 -0
  80. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color.jsx +26 -0
  81. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color_rails.md +1 -0
  82. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color_react.md +1 -0
  83. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
  84. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
  85. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +4 -0
  86. data/app/pb_kits/playbook/tokens/_colors.scss +2 -0
  87. data/app/pb_kits/playbook/tokens/_container.scss +21 -0
  88. data/app/pb_kits/playbook/utilities/_min_width.scss +45 -0
  89. data/app/pb_kits/playbook/utilities/globalPropNames.mjs +1 -0
  90. data/app/pb_kits/playbook/utilities/globalProps.ts +20 -3
  91. data/app/pb_kits/playbook/utilities/icons/allicons.tsx +59 -0
  92. data/app/pb_kits/playbook/utilities/icons/clock.svg +9 -0
  93. data/app/pb_kits/playbook/utilities/icons/spinner.svg +3 -0
  94. data/app/pb_kits/playbook/utilities/icons/times.svg +3 -0
  95. data/dist/chunks/_typeahead-BbHBDL7C.js +22 -0
  96. data/dist/chunks/_weekday_stacked-DEfI42pf.js +45 -0
  97. data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
  98. data/dist/chunks/{lib-BE0Z3F7x.js → lib-u02fp5X7.js} +2 -2
  99. data/dist/chunks/{pb_form_validation-TzZQ0Flx.js → pb_form_validation-iGj5wwU2.js} +1 -1
  100. data/dist/chunks/vendor.js +1 -1
  101. data/dist/menu.yml +4 -0
  102. data/dist/playbook-doc.js +1 -1
  103. data/dist/playbook-rails-react-bindings.js +1 -1
  104. data/dist/playbook-rails.js +1 -1
  105. data/dist/playbook.css +1 -1
  106. data/lib/playbook/classnames.rb +1 -0
  107. data/lib/playbook/spacing.rb +31 -2
  108. data/lib/playbook/version.rb +1 -1
  109. metadata +43 -10
  110. data/dist/chunks/_typeahead-D-4y9pbv.js +0 -22
  111. data/dist/chunks/_weekday_stacked-Cax4nrUa.js +0 -45
  112. data/dist/chunks/lazysizes-DHz07jlL.js +0 -1
  113. /data/app/pb_kits/playbook/pb_pagination/docs/{_pagination_default.md → _pagination_default_rails.md} +0 -0
@@ -0,0 +1,227 @@
1
+ import React from 'react'
2
+ import { FormPill, Title } from 'playbook-ui'
3
+
4
+ const FormPillColors = (props) => {
5
+ return (
6
+ <div>
7
+ <Title
8
+ marginBottom="sm"
9
+ size={4}
10
+ text="Status Colors"
11
+ {...props}
12
+ />
13
+ <FormPill
14
+ onClick={() => {
15
+ alert('Click!')
16
+ }}
17
+ tabIndex={0}
18
+ text="Neutral"
19
+ {...props}
20
+ />
21
+ <FormPill
22
+ color="primary"
23
+ onClick={() => {
24
+ alert('Click!')
25
+ }}
26
+ tabIndex={0}
27
+ text="Primary"
28
+ {...props}
29
+ />
30
+ <FormPill
31
+ color="success"
32
+ onClick={() => {
33
+ alert('Click!')
34
+ }}
35
+ tabIndex={0}
36
+ text="Success"
37
+ {...props}
38
+ />
39
+ <FormPill
40
+ color="warning"
41
+ onClick={() => {
42
+ alert('Click!')
43
+ }}
44
+ tabIndex={0}
45
+ text="Warning"
46
+ {...props}
47
+ />
48
+ <FormPill
49
+ color="error"
50
+ onClick={() => {
51
+ alert('Click!')
52
+ }}
53
+ tabIndex={0}
54
+ text="Error"
55
+ {...props}
56
+ />
57
+ <FormPill
58
+ color="info"
59
+ onClick={() => {
60
+ alert('Click!')
61
+ }}
62
+ tabIndex={0}
63
+ text="Info"
64
+ {...props}
65
+ />
66
+ <Title
67
+ marginBottom="sm"
68
+ marginTop="md"
69
+ size={4}
70
+ text="Data Colors"
71
+ {...props}
72
+ />
73
+ <FormPill
74
+ color="data_1"
75
+ onClick={() => {
76
+ alert('Click!')
77
+ }}
78
+ tabIndex={0}
79
+ text="Data 1"
80
+ {...props}
81
+ />
82
+ <FormPill
83
+ color="data_2"
84
+ onClick={() => {
85
+ alert('Click!')
86
+ }}
87
+ tabIndex={0}
88
+ text="Data 2"
89
+ {...props}
90
+ />
91
+ <FormPill
92
+ color="data_3"
93
+ onClick={() => {
94
+ alert('Click!')
95
+ }}
96
+ tabIndex={0}
97
+ text="Data 3"
98
+ {...props}
99
+ />
100
+ <FormPill
101
+ color="data_4"
102
+ onClick={() => {
103
+ alert('Click!')
104
+ }}
105
+ tabIndex={0}
106
+ text="Data 4"
107
+ {...props}
108
+ />
109
+ <FormPill
110
+ color="data_5"
111
+ onClick={() => {
112
+ alert('Click!')
113
+ }}
114
+ tabIndex={0}
115
+ text="Data 5"
116
+ {...props}
117
+ />
118
+ <FormPill
119
+ color="data_6"
120
+ onClick={() => {
121
+ alert('Click!')
122
+ }}
123
+ tabIndex={0}
124
+ text="Data 6"
125
+ {...props}
126
+ />
127
+ <FormPill
128
+ color="data_7"
129
+ onClick={() => {
130
+ alert('Click!')
131
+ }}
132
+ tabIndex={0}
133
+ text="Data 7"
134
+ {...props}
135
+ />
136
+ <FormPill
137
+ color="data_8"
138
+ onClick={() => {
139
+ alert('Click!')
140
+ }}
141
+ tabIndex={0}
142
+ text="Data 8"
143
+ {...props}
144
+ />
145
+ <Title
146
+ marginBottom="sm"
147
+ marginTop="md"
148
+ size={4}
149
+ text="Product Colors"
150
+ {...props}
151
+ />
152
+ <FormPill
153
+ color="windows"
154
+ onClick={() => {
155
+ alert('Click!')
156
+ }}
157
+ tabIndex={0}
158
+ text="Windows"
159
+ {...props}
160
+ />
161
+ <FormPill
162
+ color="siding"
163
+ onClick={() => {
164
+ alert('Click!')
165
+ }}
166
+ tabIndex={0}
167
+ text="Siding"
168
+ {...props}
169
+ />
170
+ <FormPill
171
+ color="roofing"
172
+ onClick={() => {
173
+ alert('Click!')
174
+ }}
175
+ tabIndex={0}
176
+ text="Roofing"
177
+ {...props}
178
+ />
179
+ <FormPill
180
+ color="doors"
181
+ onClick={() => {
182
+ alert('Click!')
183
+ }}
184
+ tabIndex={0}
185
+ text="Doors"
186
+ {...props}
187
+ />
188
+ <FormPill
189
+ color="gutters"
190
+ onClick={() => {
191
+ alert('Click!')
192
+ }}
193
+ tabIndex={0}
194
+ text="Gutters"
195
+ {...props}
196
+ />
197
+ <FormPill
198
+ color="solar"
199
+ onClick={() => {
200
+ alert('Click!')
201
+ }}
202
+ tabIndex={0}
203
+ text="Solar"
204
+ {...props}
205
+ />
206
+ <FormPill
207
+ color="insulation"
208
+ onClick={() => {
209
+ alert('Click!')
210
+ }}
211
+ tabIndex={0}
212
+ text="Insulation"
213
+ {...props}
214
+ />
215
+ <FormPill
216
+ color="accessories"
217
+ onClick={() => {
218
+ alert('Click!')
219
+ }}
220
+ tabIndex={0}
221
+ text="Accessories"
222
+ {...props}
223
+ />
224
+ </div>
225
+ )
226
+ }
227
+ export default FormPillColors
@@ -0,0 +1 @@
1
+ The Status, Data, and Product colors highlighted above can be passed to the `color` prop. Neutral is the default color. Form pills with a text tag, an avatar, or an icon with text tag can all receive the `color` prop.
@@ -5,11 +5,13 @@ examples:
5
5
  - form_pill_size: Form Pill Size
6
6
  - form_pill_tag: Form Pill Tag
7
7
  - form_pill_example: Example
8
- # - form_pill_icon: Form Pill Icon
8
+ - form_pill_icon: Form Pill Icon
9
+ - form_pill_colors: Form Pill Colors
9
10
 
10
11
  react:
11
12
  - form_pill_user: Form Pill User
12
13
  - form_pill_size: Form Pill Size
13
14
  - form_pill_tag: Form Pill Tag
14
15
  - form_pill_example: Example
15
- # - form_pill_icon: Form Pill Icon
16
+ - form_pill_icon: Form Pill Icon
17
+ - form_pill_colors: Form Pill Colors
@@ -3,3 +3,4 @@ export { default as FormPillSize } from './_form_pill_size.jsx'
3
3
  export { default as FormPillTag } from './_form_pill_tag.jsx'
4
4
  export { default as FormPillExample } from './_form_pill_example.jsx'
5
5
  export { default as FormPillIcon } from './_form_pill_icon.jsx'
6
+ export { default as FormPillColors } from './_form_pill_colors.jsx'
@@ -1,19 +1,19 @@
1
1
  <%= content_tag(:div, id: object.id, data: object.data, class: object.classname + object.size_class, tabindex: object.tabindex, **combined_html_options) do %>
2
2
  <% if object.name.present? %>
3
- <%= pb_rails("avatar", props: { name: object.name, image_url: object.avatar_url, size: "xs" }) %>
3
+ <%= pb_rails("avatar", props: { name: object.name, image_url: object.avatar_url, size: "xxs" }) %>
4
4
  <%= pb_rails("title", props: { text: object.name, size: 4, classname: "pb_form_pill_text" }) %>
5
5
  <% if object.icon.present? %>
6
- <%= pb_rails("icon", props: { classname: "pb_form_pill_icon", icon: object.icon }) %>
6
+ <%= pb_rails("icon", props: { classname: "pb_form_pill_icon", color: object.color, icon: object.icon }) %>
7
7
  <% end %>
8
8
  <% elsif object.text.present? %>
9
9
  <% if object.icon.present? %>
10
- <%= pb_rails("icon", props: { classname: "pb_form_pill_icon", icon: object.icon }) %>
10
+ <%= pb_rails("icon", props: { classname: "pb_form_pill_icon", color: object.color, icon: object.icon }) %>
11
11
  <% end %>
12
12
  <% if object.text.present? %>
13
13
  <%= pb_rails("title", props: { text: object.text, size: 4, classname: "pb_form_pill_tag" }) %>
14
14
  <% end %>
15
15
  <% end %>
16
16
  <%= pb_rails("body", props: { classname: "pb_form_pill_close" }) do %>
17
- <%= pb_rails("icon", props: { icon: 'times' , fixed_width: true }) %>
17
+ <%= pb_rails("icon", props: { icon: 'times', fixed_width: true, size: object.close_icon_size }) %>
18
18
  <% end %>
19
19
  <% end %>
@@ -12,8 +12,8 @@ module Playbook
12
12
  values: %w[none lowercase],
13
13
  default: "none"
14
14
  prop :color, type: Playbook::Props::Enum,
15
- values: %w[primary neutral],
16
- default: "primary"
15
+ values: %w[primary neutral success warning error info data_1 data_2 data_3 data_4 data_5 data_6 data_7 data_8 windows siding roofing doors gutters solar insulation accessories],
16
+ default: "neutral"
17
17
  prop :tabindex
18
18
  prop :icon
19
19
 
@@ -32,6 +32,10 @@ module Playbook
32
32
  def icon_class
33
33
  icon ? "icon" : nil
34
34
  end
35
+
36
+ def close_icon_size
37
+ size == "small" ? "xs" : "sm"
38
+ end
35
39
  end
36
40
  end
37
41
  end
@@ -0,0 +1,3 @@
1
+ .pb_gantt_chart {
2
+
3
+ }
@@ -0,0 +1,72 @@
1
+ import React, { useState, useEffect } from "react";
2
+ import classnames from "classnames";
3
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props";
4
+ import { globalProps } from "../utilities/globalProps";
5
+ import HighchartsReact from "highcharts-react-official";
6
+ import Highcharts from "highcharts/highcharts-gantt";
7
+
8
+ import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
9
+ import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
10
+
11
+ type GanttChartProps = {
12
+ aria?: { [key: string]: string };
13
+ className?: string;
14
+ customOptions: Partial<Highcharts.Options>;
15
+ dark?: boolean;
16
+ data?: { [key: string]: string };
17
+ htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
18
+ id?: string;
19
+ };
20
+
21
+ const GanttChart = (props: GanttChartProps) => {
22
+ const {
23
+ aria = {},
24
+ className,
25
+ customOptions = {},
26
+ dark = false,
27
+ data = {},
28
+ htmlOptions = {},
29
+ id,
30
+ } = props;
31
+
32
+ const ariaProps = buildAriaProps(aria);
33
+ const dataProps = buildDataProps(data);
34
+ const htmlProps = buildHtmlProps(htmlOptions);
35
+ const classes = classnames(
36
+ buildCss("pb_gantt_chart"),
37
+ globalProps(props),
38
+ className
39
+ );
40
+
41
+ const [options, setOptions] = useState<Highcharts.Options | undefined>(customOptions);
42
+
43
+ useEffect(() => {
44
+ setOptions(customOptions);
45
+ }, [customOptions]);
46
+
47
+ const setupTheme = () => {
48
+ dark
49
+ ? Highcharts.setOptions(highchartsDarkTheme)
50
+ : Highcharts.setOptions(highchartsTheme);
51
+ };
52
+ setupTheme();
53
+
54
+ return (
55
+ <div>
56
+ <HighchartsReact
57
+ constructorType={"ganttChart"}
58
+ containerProps={{
59
+ className: classnames(globalProps(props), classes),
60
+ id: id,
61
+ ...ariaProps,
62
+ ...dataProps,
63
+ ...htmlProps,
64
+ }}
65
+ highcharts={Highcharts}
66
+ options={options}
67
+ />
68
+ </div>
69
+ );
70
+ };
71
+
72
+ export default GanttChart;
@@ -0,0 +1,53 @@
1
+ import React from "react";
2
+ import { GanttChart } from "playbook-ui";
3
+
4
+ const mockOptions = {
5
+ title: {
6
+ text: "Simple Gantt Chart",
7
+ },
8
+
9
+ xAxis: [
10
+ {
11
+ min: Date.UTC(2014, 10, 17),
12
+ max: Date.UTC(2014, 10, 30),
13
+ },
14
+ ],
15
+
16
+ series: [
17
+ {
18
+ name: "Project 1",
19
+ data: [
20
+ {
21
+ name: "Start prototype",
22
+ start: Date.UTC(2014, 10, 18),
23
+ end: Date.UTC(2014, 10, 25),
24
+ },
25
+ {
26
+ name: "Develop",
27
+ start: Date.UTC(2014, 10, 20),
28
+ end: Date.UTC(2014, 10, 25),
29
+ },
30
+ {
31
+ name: "Run acceptance tests",
32
+ start: Date.UTC(2014, 10, 23),
33
+ end: Date.UTC(2014, 10, 26),
34
+ },
35
+ {
36
+ name: "Test prototype",
37
+ start: Date.UTC(2014, 10, 27),
38
+ end: Date.UTC(2014, 10, 29),
39
+ },
40
+ ],
41
+ },
42
+ ],
43
+ };
44
+
45
+ const GanttChartDefault = (props) => (
46
+ <div>
47
+ <GanttChart customOptions={mockOptions}
48
+ {...props}
49
+ />
50
+ </div>
51
+ );
52
+
53
+ export default GanttChartDefault;
@@ -0,0 +1,7 @@
1
+ examples:
2
+
3
+
4
+ react:
5
+ - gantt_chart_default: Default
6
+
7
+
@@ -0,0 +1 @@
1
+ export { default as GanttChartDefault } from './_gantt_chart_default.jsx'
@@ -0,0 +1,19 @@
1
+ // import { renderKit } from '../utilities/test-utils'
2
+
3
+ // import GanttChart from './_gantt_chart'
4
+
5
+ /* See these resources for more testing info:
6
+ - https://github.com/testing-library/jest-dom#usage for useage and examples
7
+ - https://jestjs.io/docs/en/using-matchers
8
+ */
9
+
10
+ test('generated scaffold test - update me', () => {
11
+ // const props = {
12
+ // data: { testid: 'default' }
13
+ // }
14
+
15
+
16
+ // const kit = renderKit(GanttChart , props)
17
+ // expect(kit).toBeInTheDocument()
18
+ })
19
+
@@ -28,7 +28,7 @@ type IconProps = {
28
28
  data?: {[key: string]: string},
29
29
  fixedWidth?: boolean,
30
30
  flip?: "horizontal" | "vertical" | "both" | "none",
31
- icon: string | ReactSVGElement,
31
+ icon?: string | ReactSVGElement,
32
32
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
33
33
  id?: string,
34
34
  inverse?: boolean,
@@ -34,6 +34,7 @@ type MultiLevelSelectProps = {
34
34
  onSelect?: (prop: { [key: string]: any }) => void
35
35
  selectedIds?: string[]
36
36
  variant?: "multi" | "single"
37
+ color?: "primary" | "neutral" | "success" | "warning" | "error" | "info" | "data_1" | "data_2" | "data_3" | "data_4" | "data_5" | "data_6" | "data_7" | "data_8" | "windows" | "siding" | "roofing" | "doors" | "gutters" | "solar" | "insulation" | "accessories",
37
38
  } & GlobalProps
38
39
 
39
40
  const MultiLevelSelect = (props: MultiLevelSelectProps) => {
@@ -50,7 +51,8 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
50
51
  treeData,
51
52
  onSelect = () => null,
52
53
  selectedIds,
53
- variant = "multi"
54
+ variant = "multi",
55
+ color = "neutral"
54
56
  } = props
55
57
 
56
58
  const ariaProps = buildAriaProps(aria)
@@ -467,9 +469,9 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
467
469
  inputDisplay === "pills"
468
470
  ? returnedArray.map((item, index) => (
469
471
  <FormPill
472
+ color={color}
470
473
  key={index}
471
474
  onClick={(event: any) => handlePillClose(event, item)}
472
- size="small"
473
475
  text={item.label}
474
476
  />
475
477
  ))
@@ -480,9 +482,9 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
480
482
  inputDisplay === "pills"
481
483
  ? defaultReturn.map((item, index) => (
482
484
  <FormPill
485
+ color={color}
483
486
  key={index}
484
487
  onClick={(event: any) => handlePillClose(event, item)}
485
- size="small"
486
488
  text={item.label}
487
489
  />
488
490
  ))
@@ -0,0 +1,72 @@
1
+ <% treeData = [{
2
+ label: "Power Home Remodeling",
3
+ value: "Power Home Remodeling",
4
+ id: "100",
5
+ expanded: true,
6
+ children: [
7
+ {
8
+ label: "People",
9
+ value: "People",
10
+ id: "101",
11
+ expanded: true,
12
+ children: [
13
+ {
14
+ label: "Talent Acquisition",
15
+ value: "Talent Acquisition",
16
+ id: "102",
17
+ },
18
+ {
19
+ label: "Business Affairs",
20
+ value: "Business Affairs",
21
+ id: "103",
22
+ children: [
23
+ {
24
+ label: "Initiatives",
25
+ value: "Initiatives",
26
+ id: "104",
27
+ },
28
+ {
29
+ label: "Learning & Development",
30
+ value: "Learning & Development",
31
+ id: "105",
32
+ },
33
+ ],
34
+ },
35
+ {
36
+ label: "People Experience",
37
+ value: "People Experience",
38
+ id: "106",
39
+ },
40
+ ],
41
+ },
42
+ {
43
+ label: "Contact Center",
44
+ value: "Contact Center",
45
+ id: "107",
46
+ children: [
47
+ {
48
+ label: "Appointment Management",
49
+ value: "Appointment Management",
50
+ id: "108",
51
+ },
52
+ {
53
+ label: "Customer Service",
54
+ value: "Customer Service",
55
+ id: "109",
56
+ },
57
+ {
58
+ label: "Energy",
59
+ value: "Energy",
60
+ id: "110",
61
+ },
62
+ ],
63
+ },
64
+ ],
65
+ }] %>
66
+
67
+ <%= pb_rails("multi_level_select", props: {
68
+ id: "multi-level-select-default-rails",
69
+ name: "my_array",
70
+ tree_data: treeData,
71
+ color: "primary"
72
+ }) %>
@@ -0,0 +1,91 @@
1
+ import React from "react";
2
+ import MultiLevelSelect from "../_multi_level_select";
3
+
4
+ const treeData = [
5
+ {
6
+ label: "Power Home Remodeling",
7
+ value: "Power Home Remodeling",
8
+ id: "powerhome1",
9
+ expanded: true,
10
+ children: [
11
+ {
12
+ label: "People",
13
+ value: "People",
14
+ id: "people1",
15
+ expanded: true,
16
+ children: [
17
+ {
18
+ label: "Talent Acquisition",
19
+ value: "Talent Acquisition",
20
+ id: "talent1",
21
+ },
22
+ {
23
+ label: "Business Affairs",
24
+ value: "Business Affairs",
25
+ id: "business1",
26
+ children: [
27
+ {
28
+ label: "Initiatives",
29
+ value: "Initiatives",
30
+ id: "initiative1",
31
+ },
32
+ {
33
+ label: "Learning & Development",
34
+ value: "Learning & Development",
35
+ id: "development1",
36
+ },
37
+ ],
38
+ },
39
+ {
40
+ label: "People Experience",
41
+ value: "People Experience",
42
+ id: "experience1",
43
+ },
44
+ ],
45
+ },
46
+ {
47
+ label: "Contact Center",
48
+ value: "Contact Center",
49
+ id: "contact1",
50
+ children: [
51
+ {
52
+ label: "Appointment Management",
53
+ value: "Appointment Management",
54
+ id: "appointment1",
55
+ },
56
+ {
57
+ label: "Customer Service",
58
+ value: "Customer Service",
59
+ id: "customer1",
60
+ },
61
+ {
62
+ label: "Energy",
63
+ value: "Energy",
64
+ id: "energy1",
65
+ },
66
+ ],
67
+ },
68
+ ],
69
+ },
70
+ ];
71
+
72
+ const MultiLevelSelectColor = (props) => {
73
+ return (
74
+ <div>
75
+ <MultiLevelSelect
76
+ color="primary"
77
+ id='multiselect-color'
78
+ onSelect={(selectedNodes) =>
79
+ console.log(
80
+ "Selected Items",
81
+ selectedNodes
82
+ )
83
+ }
84
+ treeData={treeData}
85
+ {...props}
86
+ />
87
+ </div>
88
+ )
89
+ };
90
+
91
+ export default MultiLevelSelectColor;
@@ -0,0 +1 @@
1
+ Change the form pill color by passing the optional `color` prop. Product, Data, and Status colors are available options. Check them out <a href="playbook.powerapp.cloud/kits/form_pill#form-pill-colors" target="_blank">here</a> in the Form Pill colors example.
@@ -0,0 +1 @@
1
+ Change the form pill color by passing the optional `color` prop. Product, Data, and Status colors are available options. Check them out <a href="playbook.powerapp.cloud/kits/form_pill/react#form-pill-colors" target="_blank">here</a> in the Form Pill colors example.