playbook_ui 14.19.0.pre.alpha.play2125phonenumberinputcountrysearcherrorstylefix7698 → 14.19.0.pre.rc.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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +21 -304
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +1 -5
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +1 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta.md +6 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows_react.jsx → _advanced_table_selectable_rows_no_subrows.jsx} +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md +1 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.md +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +5 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/index.js +11 -228
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +1 -9
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -1
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +0 -4
- data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +0 -3
- data/app/pb_kits/playbook/pb_avatar/avatar.html.erb +3 -3
- data/app/pb_kits/playbook/pb_avatar/avatar.rb +0 -2
- data/app/pb_kits/playbook/pb_avatar/avatar.test.js +0 -18
- data/app/pb_kits/playbook/pb_avatar/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_avatar/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_card/card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_card/card.rb +0 -12
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.html.erb +2 -2
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -4
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_draggable/draggable.rb +1 -9
- data/app/pb_kits/playbook/pb_draggable/draggable_container.rb +1 -11
- data/app/pb_kits/playbook/pb_draggable/draggable_item.rb +1 -11
- data/app/pb_kits/playbook/pb_draggable/index.js +142 -141
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +5 -33
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +0 -5
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +16 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.html.erb +2 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +64 -17
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_autocomplete_with_subcomponents.jsx → _dropdown_with_autocomplete_and_custom_display.jsx} +25 -11
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_hook.jsx +79 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +4 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +2 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +0 -4
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +1 -45
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +0 -10
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.rb +0 -3
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +2 -12
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.rb +1 -3
- data/app/pb_kits/playbook/pb_dropdown/index.js +0 -57
- data/app/pb_kits/playbook/pb_dropdown/keyboard_accessibility.js +0 -26
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownContainer.tsx +2 -1
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +4 -4
- data/app/pb_kits/playbook/pb_empty_state/_empty_state.scss +1 -8
- data/app/pb_kits/playbook/pb_empty_state/docs/example.yml +1 -5
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +18 -22
- data/app/pb_kits/playbook/pb_gantt_chart/_gantt_chart.scss +3 -0
- data/app/pb_kits/playbook/pb_gantt_chart/_gantt_chart.tsx +72 -0
- data/app/pb_kits/playbook/pb_gantt_chart/docs/_gantt_chart_default.jsx +53 -0
- data/app/pb_kits/playbook/pb_gantt_chart/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_gantt_chart/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_gantt_chart/gantt_chart.test.jsx +19 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_message/_message.tsx +0 -3
- data/app/pb_kits/playbook/pb_message/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_message/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_message/message.html.erb +1 -2
- data/app/pb_kits/playbook/pb_message/message.rb +0 -1
- data/app/pb_kits/playbook/pb_overlay/_overlay.scss +1 -2
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.jsx +1 -1
- data/app/pb_kits/playbook/pb_overlay/subcomponents/_overlay_token.tsx +4 -5
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +8 -21
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +1 -3
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +0 -3
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +0 -19
- data/app/pb_kits/playbook/pb_popover/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_popover/index.ts +1 -13
- data/app/pb_kits/playbook/pb_popover/popover.rb +0 -2
- data/app/pb_kits/playbook/pb_select/_select.scss +0 -10
- data/app/pb_kits/playbook/pb_select/docs/_select_error.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.jsx +7 -7
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +5 -5
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +2 -4
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.html.erb +1 -1
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.html.erb +1 -5
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.html.erb +1 -8
- data/app/pb_kits/playbook/pb_user/_user.tsx +0 -3
- data/app/pb_kits/playbook/pb_user/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_user/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_user/user.html.erb +1 -2
- data/app/pb_kits/playbook/pb_user/user.rb +0 -1
- data/dist/chunks/_typeahead-BX8IifKY.js +22 -0
- data/dist/chunks/_weekday_stacked-DfMD7HJz.js +45 -0
- data/dist/chunks/{lib-DwFasxbk.js → lib-96_ZmvAo.js} +1 -1
- data/dist/chunks/{pb_form_validation-nnXW3T-3.js → pb_form_validation-Vv2TqXVC.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +14 -6
- data/dist/playbook-doc.js +2 -2
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +2 -2
- metadata +23 -58
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.jsx +0 -80
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.html.erb +0 -58
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/flat_advanced_table.js +0 -106
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_grayscale.html.erb +0 -5
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_grayscale.jsx +0 -16
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.html.erb +0 -64
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.html.erb +0 -55
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors_rails.md +0 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.html.erb +0 -55
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line_rails.md +0 -5
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_rails.md +0 -5
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.jsx +0 -59
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners_react.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.html.erb +0 -28
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.html.erb +0 -58
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_external_control.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.jsx +0 -61
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.md +0 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.html.erb +0 -52
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.md +0 -2
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_alignment.html.erb +0 -27
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_default.html.erb +0 -7
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_orientation.html.erb +0 -12
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_size.html.erb +0 -23
- data/app/pb_kits/playbook/pb_empty_state/empty_state.html.erb +0 -19
- data/app/pb_kits/playbook/pb_empty_state/empty_state.rb +0 -123
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.html.erb +0 -41
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.md +0 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.jsx +0 -52
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.md +0 -1
- data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +0 -110
- data/app/pb_kits/playbook/pb_message/docs/_message_grayscale.html.erb +0 -9
- data/app/pb_kits/playbook/pb_message/docs/_message_grayscale.jsx +0 -21
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.html.erb +0 -10
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.jsx +0 -20
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.md +0 -1
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.html.erb +0 -46
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.md +0 -1
- data/app/pb_kits/playbook/pb_user/docs/_user_grayscale.html.erb +0 -6
- data/app/pb_kits/playbook/pb_user/docs/_user_grayscale.jsx +0 -16
- data/dist/chunks/_typeahead-BQV04mOl.js +0 -22
- data/dist/chunks/_weekday_stacked-CVwWr8B2.js +0 -45
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_rails.html.erb → _advanced_table_selectable_rows.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows_rails.html.erb → _advanced_table_selectable_rows_no_subrows.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows.md → _advanced_table_selectable_rows_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_react.md → _draggable_drop_zones.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_colors_react.md → _draggable_drop_zones_colors.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_line_react.md → _draggable_drop_zones_line.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_event_listeners_rails.md → _draggable_event_listeners.md} +0 -0
@@ -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 '../../pb_gantt_chart/_gantt_chart'
|
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 @@
|
|
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
|
+
|
@@ -4,4 +4,3 @@ export { default as LineGraphLegendPosition } from './_line_graph_legend_positio
|
|
4
4
|
export { default as LineGraphLegendNonclickable } from './_line_graph_legend_nonclickable.jsx'
|
5
5
|
export { default as LineGraphHeight } from './_line_graph_height.jsx'
|
6
6
|
export { default as LineGraphColors } from './_line_graph_colors.jsx'
|
7
|
-
export { default as LineGraphPbStyles } from './_line_graph_pb_styles.jsx'
|
@@ -13,7 +13,6 @@ import MessageMention from './_message_mention'
|
|
13
13
|
|
14
14
|
type MessageProps = {
|
15
15
|
aria: { [key: string]: string },
|
16
|
-
avatarGrayscale?: boolean,
|
17
16
|
avatarName?: string,
|
18
17
|
avatarStatus?: "away" | "offline" | "online",
|
19
18
|
avatarUrl?: string,
|
@@ -33,7 +32,6 @@ type MessageProps = {
|
|
33
32
|
const Message = (props: MessageProps) => {
|
34
33
|
const {
|
35
34
|
aria = {},
|
36
|
-
avatarGrayscale = false,
|
37
35
|
avatarName,
|
38
36
|
avatarStatus = null,
|
39
37
|
avatarUrl,
|
@@ -73,7 +71,6 @@ const Message = (props: MessageProps) => {
|
|
73
71
|
>
|
74
72
|
{shouldDisplayAvatar &&
|
75
73
|
<Avatar
|
76
|
-
grayscale={avatarGrayscale}
|
77
74
|
imageUrl={avatarUrl}
|
78
75
|
name={avatarName}
|
79
76
|
size="xs"
|
@@ -5,14 +5,12 @@ examples:
|
|
5
5
|
- message_timestamp: With Timestamp Hover
|
6
6
|
- message_hover: Hover
|
7
7
|
- message_mentions: Mentions
|
8
|
-
- message_grayscale: Grayscale Avatar
|
9
8
|
|
10
9
|
react:
|
11
10
|
- message_default: Default
|
12
11
|
- message_timestamp: With Timestamp Hover
|
13
12
|
- message_hover: Hover
|
14
13
|
- message_mentions: Mentions
|
15
|
-
- message_grayscale: Grayscale Avatar
|
16
14
|
|
17
15
|
swift:
|
18
16
|
- message_default_swift: Default
|
@@ -2,4 +2,3 @@ export { default as MessageDefault } from './_message_default.jsx'
|
|
2
2
|
export { default as MessageTimestamp } from './_message_timestamp.jsx'
|
3
3
|
export { default as MessageHover } from './_message_hover.jsx'
|
4
4
|
export { default as MessageMentions } from './_message_mentions.jsx'
|
5
|
-
export { default as MessageGrayscale } from './_message_grayscale.jsx'
|
@@ -78,8 +78,7 @@ $overlay_colors: (
|
|
78
78
|
&.overlay-hide-scrollbar {
|
79
79
|
& [class*="overflow_x_auto"],
|
80
80
|
& [class*="overflow_y_auto"],
|
81
|
-
& [class*="overflow_auto"]
|
82
|
-
.overlay_token_container {
|
81
|
+
& [class*="overflow_auto"] {
|
83
82
|
&::-webkit-scrollbar {
|
84
83
|
display: none !important;
|
85
84
|
}
|
@@ -30,7 +30,7 @@ const OverlayToken = (props: OverlayChildrenProps) => {
|
|
30
30
|
if (container) {
|
31
31
|
const { scrollLeft, scrollWidth, clientWidth } = container;
|
32
32
|
const atStart = scrollLeft === 0;
|
33
|
-
const atEnd = scrollLeft + clientWidth >= scrollWidth - 1;
|
33
|
+
const atEnd = scrollLeft + clientWidth >= scrollWidth - 1;
|
34
34
|
|
35
35
|
setIsAtStart(atStart);
|
36
36
|
setIsAtEnd(atEnd);
|
@@ -64,17 +64,16 @@ const OverlayToken = (props: OverlayChildrenProps) => {
|
|
64
64
|
return (
|
65
65
|
<>
|
66
66
|
<div className={dynamic ? isAtStart ? '' : previousOverlayClassName : previousOverlayClassName} />
|
67
|
-
{dynamic ?
|
67
|
+
{dynamic ?
|
68
68
|
<div
|
69
|
-
className="overlay_token_container"
|
70
69
|
ref={scrollContainerRef}
|
71
70
|
style={{
|
72
|
-
overflowX: 'auto',
|
71
|
+
overflowX: 'auto',
|
73
72
|
}}
|
74
73
|
>
|
75
74
|
{children}
|
76
75
|
</div>
|
77
|
-
:
|
76
|
+
:
|
78
77
|
children
|
79
78
|
}
|
80
79
|
{hasSubsequentOverlay &&
|
@@ -39,10 +39,7 @@ $flag-min-resolution: 192dpi;
|
|
39
39
|
color: $charcoal;
|
40
40
|
}
|
41
41
|
|
42
|
-
|
43
|
-
min-width: $dropdown-min-width;
|
44
|
-
}
|
45
|
-
// iti-spacer-horizontal's default is 8px, or $space_xs
|
42
|
+
// iti-spacer-horizontal's default is 8px, or $space_xs
|
46
43
|
.iti__country-list .iti__flag, .iti__country-name {
|
47
44
|
margin-right: $space_xs;
|
48
45
|
}
|
@@ -60,7 +57,7 @@ $flag-min-resolution: 192dpi;
|
|
60
57
|
color: $focus_input_light;
|
61
58
|
}
|
62
59
|
|
63
|
-
.dropdown_open
|
60
|
+
.dropdown_open {
|
64
61
|
.text_input {
|
65
62
|
border-color: $primary !important;
|
66
63
|
}
|
@@ -76,7 +73,7 @@ $flag-min-resolution: 192dpi;
|
|
76
73
|
}
|
77
74
|
|
78
75
|
.iti__divider {
|
79
|
-
border-bottom: 1px solid $border_light !important;
|
76
|
+
border-bottom: 1px solid $border_light !important;
|
80
77
|
}
|
81
78
|
|
82
79
|
.iti__selected-country-primary {
|
@@ -96,7 +93,7 @@ $flag-min-resolution: 192dpi;
|
|
96
93
|
justify-content: center;
|
97
94
|
align-items: center;
|
98
95
|
border-width: 0;
|
99
|
-
border-radius: $space_xxs;
|
96
|
+
border-radius: $space_xxs;
|
100
97
|
|
101
98
|
&[aria-expanded="true"] {
|
102
99
|
color: $primary_action;
|
@@ -199,7 +196,7 @@ $flag-min-resolution: 192dpi;
|
|
199
196
|
}
|
200
197
|
|
201
198
|
.iti__dropdown-content {
|
202
|
-
border-radius: $space_xs;
|
199
|
+
border-radius: $space_xs;
|
203
200
|
border: 1px solid $border_light !important;
|
204
201
|
position: absolute;
|
205
202
|
top: 100%;
|
@@ -228,22 +225,12 @@ $flag-min-resolution: 192dpi;
|
|
228
225
|
}
|
229
226
|
|
230
227
|
.iti__dropdown-content {
|
231
|
-
border-radius: $space_xs;
|
228
|
+
border-radius: $space_xs;
|
232
229
|
border: 1px solid $border_dark !important;
|
233
|
-
.iti__search-input {
|
234
|
-
background-color: $bg_dark_card;
|
235
|
-
&:hover {
|
236
|
-
background-color: $bg_dark_card;
|
237
|
-
}
|
238
|
-
&:active,
|
239
|
-
&:focus {
|
240
|
-
background-color: $card_dark;
|
241
|
-
}
|
242
|
-
}
|
243
230
|
}
|
244
231
|
|
245
232
|
.iti__divider {
|
246
|
-
border-bottom: 1px solid $border_dark !important;
|
233
|
+
border-bottom: 1px solid $border_dark !important;
|
247
234
|
}
|
248
235
|
|
249
236
|
.iti__country-list {
|
@@ -278,7 +265,7 @@ $flag-min-resolution: 192dpi;
|
|
278
265
|
color: $white;
|
279
266
|
}
|
280
267
|
}
|
281
|
-
|
268
|
+
|
282
269
|
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: $flag-min-resolution) {
|
283
270
|
.iti__flag {
|
284
271
|
background-image: url("https://unpkg.com/intl-tel-input@24.6.0/build/img/flags@2x.png");
|
@@ -37,7 +37,6 @@ type PhoneNumberInputProps = {
|
|
37
37
|
required?: boolean,
|
38
38
|
value?: string,
|
39
39
|
formatAsYouType?: boolean,
|
40
|
-
countrySearch?: boolean,
|
41
40
|
}
|
42
41
|
|
43
42
|
enum ValidationError {
|
@@ -92,7 +91,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
|
|
92
91
|
preferredCountries = [],
|
93
92
|
value = "",
|
94
93
|
formatAsYouType = false,
|
95
|
-
countrySearch = false,
|
96
94
|
} = props
|
97
95
|
|
98
96
|
const ariaProps = buildAriaProps(aria)
|
@@ -244,7 +242,7 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
|
|
244
242
|
autoInsertDialCode: false,
|
245
243
|
initialCountry: initialCountry || fallbackCountry,
|
246
244
|
onlyCountries,
|
247
|
-
countrySearch:
|
245
|
+
countrySearch: false,
|
248
246
|
fixDropdownWidth: false,
|
249
247
|
formatAsYouType: formatAsYouType,
|
250
248
|
hiddenInput: hiddenInputs ? () => ({
|
@@ -9,7 +9,6 @@ examples:
|
|
9
9
|
- phone_number_input_clear_field: Clearing the Input Field
|
10
10
|
- phone_number_input_access_input_element: Accessing the Input Element
|
11
11
|
- phone_number_input_format: Format as You Type
|
12
|
-
- phone_number_input_country_search: Country Search
|
13
12
|
|
14
13
|
rails:
|
15
14
|
- phone_number_input_default: Default
|
@@ -19,5 +18,4 @@ examples:
|
|
19
18
|
- phone_number_input_validation: Form Validation
|
20
19
|
- phone_number_input_format: Format as You Type
|
21
20
|
- phone_number_input_hidden_inputs: Hidden Inputs
|
22
|
-
- phone_number_input_country_search: Country Search
|
23
21
|
|
@@ -6,4 +6,3 @@ export { default as PhoneNumberInputValidation } from './_phone_number_input_val
|
|
6
6
|
export { default as PhoneNumberInputClearField } from './_phone_number_input_clear_field'
|
7
7
|
export { default as PhoneNumberInputAccessInputElement } from './_phone_number_input_access_input_element'
|
8
8
|
export { default as PhoneNumberInputFormat } from './_phone_number_input_format'
|
9
|
-
export { default as PhoneNumberInputCountrySearch } from './_phone_number_input_country_search'
|
@@ -25,8 +25,6 @@ module Playbook
|
|
25
25
|
default: false
|
26
26
|
prop :hidden_inputs, type: Playbook::Props::Boolean,
|
27
27
|
default: false
|
28
|
-
prop :country_search, type: Playbook::Props::Boolean,
|
29
|
-
default: false
|
30
28
|
|
31
29
|
def classname
|
32
30
|
generate_classname("pb_phone_number_input")
|
@@ -47,7 +45,6 @@ module Playbook
|
|
47
45
|
preferredCountries: preferred_countries,
|
48
46
|
required: required,
|
49
47
|
value: value,
|
50
|
-
countrySearch: country_search,
|
51
48
|
}
|
52
49
|
end
|
53
50
|
end
|
@@ -139,22 +139,3 @@ test("should format phone number as '555-555-5555' with formatAsYouType and 'us'
|
|
139
139
|
|
140
140
|
expect(input.value).toBe("555-555-5555");
|
141
141
|
});
|
142
|
-
|
143
|
-
test("should pass countrySearch prop to component", () => {
|
144
|
-
window.intlTelInput = jest.fn(() => ({
|
145
|
-
getSelectedCountryData: jest.fn(() => ({})),
|
146
|
-
isValidNumber: jest.fn(() => true),
|
147
|
-
getValidationError: jest.fn(() => 0),
|
148
|
-
}));
|
149
|
-
|
150
|
-
const props = {
|
151
|
-
id: testId,
|
152
|
-
countrySearch: true,
|
153
|
-
data: { testid: 'phone-input-with-search' }
|
154
|
-
};
|
155
|
-
|
156
|
-
render(<PhoneNumberInput {...props} />);
|
157
|
-
|
158
|
-
const wrapper = screen.getByTestId('phone-input-with-search');
|
159
|
-
expect(wrapper).toBeInTheDocument();
|
160
|
-
});
|
@@ -13,15 +13,7 @@ export default class PbPopover extends PbEnhancedElement {
|
|
13
13
|
}
|
14
14
|
|
15
15
|
moveTooltip() {
|
16
|
-
|
17
|
-
|
18
|
-
if (this.appendTo === "parent") {
|
19
|
-
container = this.element.parentElement;
|
20
|
-
} else if (this.appendTo) {
|
21
|
-
container = document.querySelector(this.appendTo);
|
22
|
-
}
|
23
|
-
|
24
|
-
(container || document.body).appendChild(this.tooltip);
|
16
|
+
document.querySelector('body').appendChild(this.tooltip)
|
25
17
|
}
|
26
18
|
|
27
19
|
connect() {
|
@@ -116,8 +108,4 @@ export default class PbPopover extends PbEnhancedElement {
|
|
116
108
|
get closeOnClick() {
|
117
109
|
return this.element.dataset.pbPopoverCloseOnClick
|
118
110
|
}
|
119
|
-
|
120
|
-
get appendTo() {
|
121
|
-
return this.element.dataset.pbPopoverAppendTo;
|
122
|
-
}
|
123
111
|
}
|
@@ -3,7 +3,6 @@
|
|
3
3
|
module Playbook
|
4
4
|
module PbPopover
|
5
5
|
class Popover < Playbook::KitBase
|
6
|
-
prop :append_to, type: Playbook::Props::String, default: "body"
|
7
6
|
prop :position, type: Playbook::Props::Enum,
|
8
7
|
values: %w[top bottom left right top-start top-end bottom-start bottom-end right-start right-end left-start left-end],
|
9
8
|
default: "left"
|
@@ -48,7 +47,6 @@ module Playbook
|
|
48
47
|
|
49
48
|
def data
|
50
49
|
Hash(values[:data]).merge(
|
51
|
-
pb_popover_append_to: append_to,
|
52
50
|
pb_popover_kit: true,
|
53
51
|
pb_popover_position: position,
|
54
52
|
pb_popover_trigger_element_id: trigger_element_id,
|
@@ -143,16 +143,6 @@
|
|
143
143
|
select {
|
144
144
|
font-size: 12px;
|
145
145
|
}
|
146
|
-
.pb_select_kit_wrapper.error {
|
147
|
-
.pb_select_kit_caret {
|
148
|
-
top: 13.7px;
|
149
|
-
}
|
150
|
-
}
|
151
|
-
}
|
152
|
-
.pb_select_kit_wrapper.error {
|
153
|
-
.pb_select_kit_caret {
|
154
|
-
top: 16.2px;
|
155
|
-
}
|
156
146
|
}
|
157
147
|
}
|
158
148
|
}
|
@@ -8,7 +8,7 @@ const TableWithCollapsibleWithCustomClick = (props) => {
|
|
8
8
|
|
9
9
|
const Content = () => {
|
10
10
|
return (
|
11
|
-
<Card
|
11
|
+
<Card
|
12
12
|
borderNone
|
13
13
|
borderRadius="none"
|
14
14
|
padding="md"
|
@@ -37,7 +37,7 @@ return (
|
|
37
37
|
|
38
38
|
</Table.Head>
|
39
39
|
<Table.Body>
|
40
|
-
<Table.Row collapsible
|
40
|
+
<Table.Row collapsible
|
41
41
|
collapsibleContent={<Content/>}
|
42
42
|
toggleCellId="cell-1"
|
43
43
|
{...props}
|
@@ -47,7 +47,7 @@ return (
|
|
47
47
|
<Table.Cell>{'Value 3'}</Table.Cell>
|
48
48
|
<Table.Cell>{'Value 4'}</Table.Cell>
|
49
49
|
<Table.Cell>{'Value 5'}</Table.Cell>
|
50
|
-
<Table.Cell cursor="pointer"
|
50
|
+
<Table.Cell cursor="pointer"
|
51
51
|
id="cell-1"
|
52
52
|
textAlign="right"
|
53
53
|
>
|
@@ -59,7 +59,7 @@ return (
|
|
59
59
|
</Table.Cell>
|
60
60
|
|
61
61
|
</Table.Row>
|
62
|
-
<Table.Row collapsible
|
62
|
+
<Table.Row collapsible
|
63
63
|
collapsibleContent={<Content/>}
|
64
64
|
toggleCellId="cell-2"
|
65
65
|
{...props}
|
@@ -69,7 +69,7 @@ return (
|
|
69
69
|
<Table.Cell>{'Value 3'}</Table.Cell>
|
70
70
|
<Table.Cell>{'Value 4'}</Table.Cell>
|
71
71
|
<Table.Cell>{'Value 5'}</Table.Cell>
|
72
|
-
<Table.Cell cursor="pointer"
|
72
|
+
<Table.Cell cursor="pointer"
|
73
73
|
id="cell-2"
|
74
74
|
textAlign="right"
|
75
75
|
>
|
@@ -81,7 +81,7 @@ return (
|
|
81
81
|
</Table.Cell>
|
82
82
|
|
83
83
|
</Table.Row>
|
84
|
-
<Table.Row collapsible
|
84
|
+
<Table.Row collapsible
|
85
85
|
collapsibleContent={<Content/>}
|
86
86
|
toggleCellId="cell-3"
|
87
87
|
{...props}
|
@@ -91,7 +91,7 @@ return (
|
|
91
91
|
<Table.Cell>{'Value 3'}</Table.Cell>
|
92
92
|
<Table.Cell>{'Value 4'}</Table.Cell>
|
93
93
|
<Table.Cell>{'Value 5'}</Table.Cell>
|
94
|
-
<Table.Cell cursor="pointer"
|
94
|
+
<Table.Cell cursor="pointer"
|
95
95
|
id="cell-3"
|
96
96
|
textAlign="right"
|
97
97
|
>
|
@@ -55,7 +55,7 @@ const TableRow = (props: TableRowPropTypes): React.ReactElement => {
|
|
55
55
|
const htmlProps = buildHtmlProps(htmlOptions);
|
56
56
|
const sideHighlightClass =
|
57
57
|
sideHighlightColor != "" ? `side_highlight_${sideHighlightColor}` : null;
|
58
|
-
|
58
|
+
|
59
59
|
const [isCollapsed, setIsCollapsed] = useCollapsible(true);
|
60
60
|
|
61
61
|
const collapsibleRow = collapsible && isCollapsed === true ? "collapsible_table_row" : null;
|
@@ -83,14 +83,14 @@ const TableRow = (props: TableRowPropTypes): React.ReactElement => {
|
|
83
83
|
target instanceof SVGElement &&
|
84
84
|
(target.matches("svg.pb_custom_icon") || target.closest("svg.pb_custom_icon"));
|
85
85
|
|
86
|
-
if (clickedCell ||
|
86
|
+
if (clickedCell || isIconClick) {
|
87
87
|
setIsCollapsed(!isCollapsed);
|
88
88
|
}
|
89
89
|
} else {
|
90
90
|
setIsCollapsed(!isCollapsed);
|
91
91
|
}
|
92
92
|
};
|
93
|
-
|
93
|
+
|
94
94
|
return (
|
95
95
|
<>
|
96
96
|
{collapsible ? (
|
@@ -116,7 +116,7 @@ const TableRow = (props: TableRowPropTypes): React.ReactElement => {
|
|
116
116
|
tag="td"
|
117
117
|
>
|
118
118
|
<tr/>
|
119
|
-
<Collapsible.Content
|
119
|
+
<Collapsible.Content
|
120
120
|
className={collapsibleSideHighlight ? `table_collapsible_side_highlight` : ''}
|
121
121
|
dark={dark}
|
122
122
|
margin="none"
|
@@ -149,7 +149,7 @@ const TableRow = (props: TableRowPropTypes): React.ReactElement => {
|
|
149
149
|
tag="td"
|
150
150
|
>
|
151
151
|
<tr/>
|
152
|
-
<Collapsible.Content
|
152
|
+
<Collapsible.Content
|
153
153
|
className={collapsibleSideHighlight ? `table_collapsible_side_highlight` : ''}
|
154
154
|
dark={dark}
|
155
155
|
margin="none"
|
@@ -71,8 +71,7 @@
|
|
71
71
|
}
|
72
72
|
&.error {
|
73
73
|
.text_input_wrapper {
|
74
|
-
|
75
|
-
input:not(.iti__search-input),
|
74
|
+
input,
|
76
75
|
.text_input {
|
77
76
|
border-color: $error_dark;
|
78
77
|
}
|
@@ -103,8 +102,7 @@
|
|
103
102
|
[class*="pb_body_kit"] {
|
104
103
|
margin-top: $space_xs / 2;
|
105
104
|
}
|
106
|
-
|
107
|
-
input:not(.iti__search-input),
|
105
|
+
input,
|
108
106
|
.text_input {
|
109
107
|
border-color: $error;
|
110
108
|
}
|