playbook_ui 14.5.0.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4216 → 14.5.0.pre.alpha.PLAY1486highchartscssdrivenPOC3930
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +7 -25
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/index.js +0 -60
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +9 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +9 -1
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.scss +54 -0
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +5 -184
- data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +1 -1
- data/app/pb_kits/playbook/pb_card/_card.tsx +1 -5
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +2 -1
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +5 -216
- data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +1 -1
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +1 -5
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.html.erb +7 -30
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.md +2 -0
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +3 -84
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +5 -28
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +0 -3
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +1 -10
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -1
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +2 -2
- data/app/pb_kits/playbook/pb_filter/Filter/FilterDouble.tsx +0 -2
- data/app/pb_kits/playbook/pb_filter/Filter/FilterSingle.tsx +0 -2
- data/app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.tsx +1 -4
- data/app/pb_kits/playbook/pb_filter/Filter/ResultsCount.tsx +2 -4
- data/app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +0 -3
- data/app/pb_kits/playbook/pb_filter/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_filter/filter.html.erb +2 -2
- data/app/pb_kits/playbook/pb_filter/filter.rb +0 -2
- data/app/pb_kits/playbook/pb_flex/_flex.tsx +1 -3
- data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +2 -8
- data/app/pb_kits/playbook/pb_flex/flex_item.html.erb +6 -3
- data/app/pb_kits/playbook/pb_flex/flex_item.rb +2 -7
- data/app/pb_kits/playbook/pb_form/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_form/form.rb +0 -2
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -9
- data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_form_pill/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_gantt_chart/_gantt_chart.tsx +3 -64
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +5 -203
- data/app/pb_kits/playbook/pb_gauge/gauge.test.js +1 -1
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +5 -154
- data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +227 -211
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +65 -169
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.test.js +5 -5
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +9 -15
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +6 -28
- data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb +1 -31
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +18 -86
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +6 -15
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_preferred_countries.md +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/intlTelInput.scss +931 -849
- data/app/pb_kits/playbook/pb_phone_number_input/types.d.ts +1 -4
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +2 -6
- data/app/pb_kits/playbook/pb_popover/docs/_popover_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_popover/popover.rb +1 -3
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -67
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +0 -1
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.rb +1 -5
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +5 -113
- data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +1 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -4
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -3
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -3
- data/app/pb_kits/playbook/utilities/globalPropNames.mjs +0 -3
- data/app/pb_kits/playbook/utilities/globalProps.ts +2 -39
- data/dist/chunks/_typeahead-BywvWGAm.js +22 -0
- data/dist/chunks/_weekday_stacked-5OGZKZeo.js +45 -0
- data/dist/chunks/lib-DMOmCoAX.js +29 -0
- data/dist/chunks/{pb_form_validation-BkWGwJsl.js → pb_form_validation-Dna2I7fw.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- 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/kit_base.rb +1 -21
- data/lib/playbook/pb_doc_helper.rb +5 -5
- data/lib/playbook/pb_forms_helper.rb +1 -3
- data/lib/playbook/version.rb +1 -1
- metadata +6 -35
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx +0 -72
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.md +0 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.jsx +0 -45
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.html.erb +0 -9
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.jsx +0 -33
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.html.erb +0 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.jsx +0 -34
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md +0 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_popover_props.html.erb +0 -41
- data/app/pb_kits/playbook/pb_filter/docs/_filter_popover_props.jsx +0 -71
- data/app/pb_kits/playbook/pb_filter/docs/_filter_popover_props_rails.md +0 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_popover_props_react.md +0 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.html.erb +0 -39
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.md +0 -1
- data/app/pb_kits/playbook/pb_form/formHelper.js +0 -27
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb +0 -19
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx +0 -27
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/context/index.tsx +0 -5
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_reset.html.erb +0 -93
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_reset.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.jsx +0 -105
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.jsx +0 -106
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select_options.tsx +0 -149
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_size.html.erb +0 -336
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_size.jsx +0 -97
- data/dist/chunks/_typeahead-BhHnXJjy.js +0 -22
- data/dist/chunks/_weekday_stacked-B9Sy5PN8.js +0 -45
- data/dist/chunks/lib-D-mTv-kp.js +0 -29
@@ -21,7 +21,7 @@ import classnames from "classnames";
|
|
21
21
|
import { globalProps, GlobalProps } from "../utilities/globalProps";
|
22
22
|
import { uniqueId } from 'lodash';
|
23
23
|
|
24
|
-
type ModifiedGlobalProps = Omit<GlobalProps, 'minWidth'
|
24
|
+
type ModifiedGlobalProps = Omit<GlobalProps, 'minWidth'>
|
25
25
|
|
26
26
|
type PbPopoverProps = {
|
27
27
|
aria?: { [key: string]: string };
|
@@ -79,7 +79,6 @@ const Popover = (props: PbPopoverProps) => {
|
|
79
79
|
maxWidth,
|
80
80
|
minHeight,
|
81
81
|
minWidth,
|
82
|
-
width,
|
83
82
|
targetId,
|
84
83
|
} = props;
|
85
84
|
|
@@ -98,8 +97,7 @@ const Popover = (props: PbPopoverProps) => {
|
|
98
97
|
maxHeight ? { maxHeight: maxHeight } : {},
|
99
98
|
maxWidth ? { maxWidth: maxWidth } : {},
|
100
99
|
minHeight ? { minHeight: minHeight } : {},
|
101
|
-
minWidth ? { minWidth: minWidth } : {}
|
102
|
-
width ? { width: width } : {}
|
100
|
+
minWidth ? { minWidth: minWidth } : {}
|
103
101
|
);
|
104
102
|
};
|
105
103
|
const ariaProps = buildAriaProps(aria);
|
@@ -169,7 +167,6 @@ const PbReactPopover = (props: PbPopoverProps): React.ReactElement => {
|
|
169
167
|
maxWidth,
|
170
168
|
minHeight,
|
171
169
|
minWidth,
|
172
|
-
width,
|
173
170
|
} = props;
|
174
171
|
|
175
172
|
useEffect(() => {
|
@@ -219,7 +216,6 @@ const PbReactPopover = (props: PbPopoverProps): React.ReactElement => {
|
|
219
216
|
placement={placement}
|
220
217
|
referenceElement={referenceElement}
|
221
218
|
targetId={targetId}
|
222
|
-
width={width}
|
223
219
|
zIndex={zIndex}
|
224
220
|
{...props}
|
225
221
|
>
|
@@ -12,7 +12,6 @@ module Playbook
|
|
12
12
|
prop :max_width
|
13
13
|
prop :min_width
|
14
14
|
prop :min_height
|
15
|
-
prop :width
|
16
15
|
prop :z_index, type: Playbook::Props::String
|
17
16
|
prop :offset, type: Playbook::Props::Boolean, default: false
|
18
17
|
prop :close_on_click, type: Playbook::Props::Enum,
|
@@ -37,12 +36,11 @@ module Playbook
|
|
37
36
|
out += "max-width: #{max_width}; " if max_width.present?
|
38
37
|
out += "min-height: #{min_height}; " if min_height.present?
|
39
38
|
out += "min-width: #{min_width};" if min_width.present?
|
40
|
-
out += "width: #{width};" if width.present?
|
41
39
|
out
|
42
40
|
end
|
43
41
|
|
44
42
|
def width_height_class_helper
|
45
|
-
"overflow_handling" if max_height || max_width
|
43
|
+
"overflow_handling" if max_height || max_width
|
46
44
|
end
|
47
45
|
|
48
46
|
def data
|
@@ -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,54 +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
|
-
}
|
130
|
-
}
|
131
|
-
|
132
|
-
&[class*=_display_input] {
|
133
|
-
input[type="checkbox"],
|
134
|
-
input[type="radio"] {
|
135
|
-
&:checked {
|
136
|
-
~label {
|
137
|
-
border-width: $pb_card_border_width;
|
138
|
-
outline: 1px solid $primary;
|
139
|
-
}
|
140
|
-
|
141
|
-
}
|
142
|
-
}
|
143
|
-
|
144
|
-
> label {
|
145
|
-
outline: 1px solid transparent;
|
146
|
-
padding: $space_sm;
|
147
|
-
}
|
148
|
-
|
149
|
-
&.dark {
|
150
|
-
input[type="checkbox"],
|
151
|
-
input[type="radio"] {
|
152
|
-
&:checked ~ label {
|
153
|
-
border-width: $pb_card_border_width;
|
154
|
-
outline: 1px solid $primary;
|
155
|
-
}
|
156
|
-
}
|
157
91
|
}
|
158
92
|
}
|
159
93
|
|
@@ -25,7 +25,7 @@
|
|
25
25
|
<% end %>
|
26
26
|
<div class="separator"></div>
|
27
27
|
<div class="psuedo_separator"></div>
|
28
|
-
<%= pb_rails("card", props: { padding: "sm", status: object.status, border_none: true
|
28
|
+
<%= pb_rails("card", props: { padding: "sm", status: object.status, border_none: true }) do %>
|
29
29
|
<% if content.nil? %>
|
30
30
|
<%= pb_rails("body", props: { text: object.text }) %>
|
31
31
|
<% else %>
|
@@ -25,7 +25,7 @@ module Playbook
|
|
25
25
|
|
26
26
|
def classname
|
27
27
|
[
|
28
|
-
generate_classname_without_spacing("pb_selectable_card_kit", checked_class, enable_disabled_class
|
28
|
+
generate_classname_without_spacing("pb_selectable_card_kit", checked_class, enable_disabled_class),
|
29
29
|
error_class,
|
30
30
|
dark_props,
|
31
31
|
].compact.join(" ")
|
@@ -79,10 +79,6 @@ module Playbook
|
|
79
79
|
def error_class
|
80
80
|
error ? "error" : nil
|
81
81
|
end
|
82
|
-
|
83
|
-
def display_input_class
|
84
|
-
variant == "display_input" ? "display_input" : nil
|
85
|
-
end
|
86
82
|
end
|
87
83
|
end
|
88
84
|
end
|
@@ -1,118 +1,10 @@
|
|
1
|
-
import 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
|
-
<
|
106
|
-
|
107
|
-
|
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
|
|
@@ -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(
|
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
|
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?
|
@@ -170,24 +170,12 @@ type ZIndex = {
|
|
170
170
|
zIndex?: ZIndexType,
|
171
171
|
} | ZIndexResponsiveType
|
172
172
|
|
173
|
-
type Height = {
|
174
|
-
height?: string
|
175
|
-
}
|
176
|
-
|
177
|
-
type MaxHeight = {
|
178
|
-
maxHeight?: string
|
179
|
-
}
|
180
|
-
|
181
|
-
type MinHeight = {
|
182
|
-
minHeight?: string
|
183
|
-
}
|
184
|
-
|
185
173
|
// keep this as the last type definition
|
186
174
|
export type GlobalProps = AlignContent & AlignItems & AlignSelf &
|
187
175
|
BorderRadius & Cursor & Dark & Display & DisplaySizes & Flex & FlexDirection &
|
188
176
|
FlexGrow & FlexShrink & FlexWrap & JustifyContent & JustifySelf &
|
189
177
|
LineHeight & Margin & MinWidth & MaxWidth & NumberSpacing & Order & Overflow & Padding &
|
190
|
-
Position & Shadow & TextAlign & Truncate & VerticalAlign & ZIndex & { hover?: string } & Top & Right & Bottom & Left
|
178
|
+
Position & Shadow & TextAlign & Truncate & VerticalAlign & ZIndex & { hover?: string } & Top & Right & Bottom & Left;
|
191
179
|
|
192
180
|
const getResponsivePropClasses = (prop: {[key: string]: string}, classPrefix: string) => {
|
193
181
|
const keys: string[] = Object.keys(prop)
|
@@ -510,22 +498,7 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
510
498
|
} else {
|
511
499
|
return verticalAlign ? `vertical_align_${verticalAlign} ` : ''
|
512
500
|
}
|
513
|
-
}
|
514
|
-
|
515
|
-
}
|
516
|
-
|
517
|
-
const PROP_INLINE_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => {[key: string]: any}} = {
|
518
|
-
heightProps: ({ height }: Height) => {
|
519
|
-
return height ? { height } : {};
|
520
|
-
},
|
521
|
-
|
522
|
-
maxHeightProps: ({ maxHeight }: MaxHeight) => {
|
523
|
-
return maxHeight ? { maxHeight } : {};
|
524
|
-
},
|
525
|
-
|
526
|
-
minHeightProps: ({ minHeight }: MinHeight) => {
|
527
|
-
return minHeight ? { minHeight } : {};
|
528
|
-
},
|
501
|
+
}
|
529
502
|
}
|
530
503
|
|
531
504
|
type DefaultProps = {[key: string]: string} | Record<string, unknown>
|
@@ -537,16 +510,6 @@ export const globalProps = (props: GlobalProps, defaultProps: DefaultProps = {})
|
|
537
510
|
}).filter((value) => value?.length > 0).join(" ")
|
538
511
|
}
|
539
512
|
|
540
|
-
// New function for inline styles
|
541
|
-
export const globalInlineProps = (props: GlobalProps): React.CSSProperties => {
|
542
|
-
const styles = Object.keys(PROP_INLINE_CATEGORIES).reduce((acc, key) => {
|
543
|
-
const result = PROP_INLINE_CATEGORIES[key](props);
|
544
|
-
return { ...acc, ...(typeof result === 'object' ? result : {}) }; // Ensure result is an object before spreading
|
545
|
-
}, {});
|
546
|
-
|
547
|
-
return styles; // Return the styles object directly
|
548
|
-
}
|
549
|
-
|
550
513
|
|
551
514
|
export const deprecatedProps = (): void => {
|
552
515
|
// if (process.env.NODE_ENV === 'development') {
|