playbook_ui 14.18.0.pre.alpha.play2034zonesandcolors7407 → 14.18.0.pre.alpha.play2087emptystatekitbuildrails7533
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/pb_advanced_table/_advanced_table.scss +304 -21
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +5 -1
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +6 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta.md +0 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.jsx +80 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.html.erb +58 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md +5 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows.jsx → _advanced_table_selectable_rows_no_subrows_react.jsx} +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.md +3 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +6 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +3 -2
- data/app/pb_kits/playbook/pb_advanced_table/flat_advanced_table.js +106 -0
- data/app/pb_kits/playbook/pb_advanced_table/index.js +228 -11
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +9 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +1 -2
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +12 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +12 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +50 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.html.erb +2 -2
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_rails.md +4 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.md +1 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.md +5 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.jsx +34 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.md +14 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +20 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +14 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +10 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.html.erb +5 -2
- data/app/pb_kits/playbook/pb_empty_state/_empty_state.scss +7 -1
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_alignment.html.erb +30 -0
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_default.html.erb +8 -0
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_orientation.html.erb +13 -0
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_size.html.erb +23 -0
- data/app/pb_kits/playbook/pb_empty_state/docs/example.yml +5 -1
- data/app/pb_kits/playbook/pb_empty_state/empty_state.html.erb +24 -0
- data/app/pb_kits/playbook/pb_empty_state/empty_state.rb +123 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.html.erb +41 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.md +1 -0
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +22 -18
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.jsx +52 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +110 -0
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +13 -0
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +3 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.html.erb +10 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.jsx +20 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.md +1 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +3 -0
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +19 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.html.erb +46 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.md +1 -0
- data/app/pb_kits/playbook/pb_popover/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_popover/index.ts +13 -1
- data/app/pb_kits/playbook/pb_popover/popover.rb +2 -0
- data/app/pb_kits/playbook/pb_select/_select.scss +10 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_error.html.erb +1 -1
- 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 +5 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.html.erb +8 -1
- data/dist/chunks/{_typeahead-CvkGr9xV.js → _typeahead-D8CsVBZO.js} +2 -2
- data/dist/chunks/_weekday_stacked-D3oLTSkH.js +45 -0
- data/dist/chunks/{lib-yWHJ_8mm.js → lib-BmTAc7Nc.js} +1 -1
- data/dist/chunks/{pb_form_validation-CFPfX89U.js → pb_form_validation-BWjy4bFn.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +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/version.rb +1 -1
- metadata +35 -10
- data/dist/chunks/_weekday_stacked-B-ran-L1.js +0 -45
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_react.md → _advanced_table_selectable_rows.md} +0 -0
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows.html.erb → _advanced_table_selectable_rows_no_subrows_rails.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows.html.erb → _advanced_table_selectable_rows_rails.html.erb} +0 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
You can link a Quickpick DatePicker to standard DatePickers using the following props:
|
2
|
+
|
3
|
+
**For the Quickpick DatePicker**:
|
4
|
+
`controlsStartId`: ID of the DatePicker that should receive the start date.
|
5
|
+
|
6
|
+
`controlsEndId`: ID of the DatePicker that should receive the end date.
|
7
|
+
|
8
|
+
When a quickpick option like “This Year” is selected, it automatically populates the linked start and end inputs.
|
9
|
+
|
10
|
+
**For the Start/End DatePickers**:
|
11
|
+
`syncStartWith`: ID of the quickpick this start date is synced to.
|
12
|
+
`syncEndWith`: ID of the quickpick this end date is synced to.
|
13
|
+
|
14
|
+
When a user manually edits the start or end date, it clears the selected quickpick to prevent conflicting values.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<%= pb_rails("date_picker", props: {
|
2
|
+
mode: "range",
|
3
|
+
picker_id: "quick-pick-date-range",
|
4
|
+
placeholder: "Select a Date Range",
|
5
|
+
selection_type: "quickpick",
|
6
|
+
controls_end_id: "quick-pick-date-range-end",
|
7
|
+
controls_start_id: "quick-pick-date-range-start",
|
8
|
+
}) %>
|
9
|
+
|
10
|
+
<%= pb_rails("date_picker", props: {
|
11
|
+
picker_id: "quick-pick-date-range-start",
|
12
|
+
placeholder: "Select a Start Date",
|
13
|
+
sync_start_with:"quick-pick-date-range",
|
14
|
+
}) %>
|
15
|
+
|
16
|
+
<%= pb_rails("date_picker", props: {
|
17
|
+
picker_id: "quick-pick-date-range-end",
|
18
|
+
placeholder: "Select an End Date",
|
19
|
+
sync_end_with:"quick-pick-date-range",
|
20
|
+
}) %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
You can link a Quickpick DatePicker to standard DatePickers using the following props:
|
2
|
+
|
3
|
+
**For the Quickpick DatePicker**:
|
4
|
+
`controls_start_id`: ID of the DatePicker that should receive the start date.
|
5
|
+
|
6
|
+
`controls_end_id`: ID of the DatePicker that should receive the end date.
|
7
|
+
|
8
|
+
When a quickpick option like “This Year” is selected, it automatically populates the linked start and end inputs.
|
9
|
+
|
10
|
+
**For the Start/End DatePickers**:
|
11
|
+
`sync_start_with`: ID of the quickpick this start date is synced to.
|
12
|
+
`sync_end_with`: ID of the quickpick this end date is synced to.
|
13
|
+
|
14
|
+
When a user manually edits the start or end date, it clears the selected quickpick to prevent conflicting values.
|
@@ -15,6 +15,7 @@ examples:
|
|
15
15
|
- date_picker_quick_pick_custom: Custom Quick Pick Dates
|
16
16
|
- date_picker_quick_pick_custom_override: Custom Quick Pick Dates (append to defaults)
|
17
17
|
- date_picker_quick_pick_default_date: Range (Quick Pick w/ Default Date)
|
18
|
+
- date_picker_range_pattern_rails: Range with 2 Date Pickers and a Quick Pick
|
18
19
|
- date_picker_format: Format
|
19
20
|
- date_picker_disabled: Disabled Dates
|
20
21
|
- date_picker_min_max: Min Max
|
@@ -47,6 +48,7 @@ examples:
|
|
47
48
|
- date_picker_quick_pick_custom: Custom Quick Pick Dates
|
48
49
|
- date_picker_quick_pick_custom_override: Custom Quick Pick Dates (append to defaults)
|
49
50
|
- date_picker_quick_pick_default_date: Range (Quick Pick w/ Default Date)
|
51
|
+
- date_picker_range_pattern: Range with 2 Date Pickers and a Quick Pick
|
50
52
|
- date_picker_format: Format
|
51
53
|
- date_picker_disabled: Disabled Dates
|
52
54
|
- date_picker_min_max: Min Max
|
@@ -26,3 +26,4 @@ export { default as DatePickerOnClose } from './_date_picker_on_close.jsx'
|
|
26
26
|
export { default as DatePickerQuickPickCustom } from './_date_picker_quick_pick_custom'
|
27
27
|
export { default as DatePickerQuickPickCustomOverride } from './_date_picker_quick_pick_custom_override'
|
28
28
|
export { default as DatePickerQuickPickDefaultDate } from './_date_picker_quick_pick_default_date'
|
29
|
+
export { default as DatePickerRangePattern } from './_date_picker_range_pattern'
|
@@ -238,6 +238,16 @@ const quickPickPlugin = (thisRangesEndToday: boolean, customQuickPickDates: cust
|
|
238
238
|
},
|
239
239
|
|
240
240
|
onClose(selectedDates: Array<Date>) {
|
241
|
+
// Patch .clear() to also remove active state if cleared
|
242
|
+
const originalClear = fp.clear;
|
243
|
+
fp.clear = function (...args: any) {
|
244
|
+
const current = pluginData.rangesNav.querySelector('.active');
|
245
|
+
if (current) {
|
246
|
+
current.classList.remove('active');
|
247
|
+
}
|
248
|
+
activeLabel = "";
|
249
|
+
return originalClear.apply(this, args);
|
250
|
+
};
|
241
251
|
// remove the active class from the button if the selected dates don't match the label
|
242
252
|
if (!isLabelMatchingSelectedDates(selectedDates)) {
|
243
253
|
pluginData.rangesButtons[activeLabel]?.classList.remove('active');
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%
|
1
|
+
<%
|
2
2
|
options = [
|
3
3
|
{ label: 'United States', value: 'United States', id: 'us' },
|
4
4
|
{ label: 'Canada', value: 'Canada', id: 'ca' },
|
@@ -6,4 +6,7 @@
|
|
6
6
|
]
|
7
7
|
%>
|
8
8
|
|
9
|
-
<%= pb_rails("dropdown", props: {
|
9
|
+
<%= pb_rails("dropdown", props: {
|
10
|
+
error: raw(pb_rails("icon", props: { icon: "warning" }) + " Please make a valid selection"),
|
11
|
+
options: options
|
12
|
+
}) %>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<%= pb_rails("flex", props: {align: "center", spacing: "evenly"}) do %>
|
2
|
+
<%= pb_rails("empty_state", props: {
|
3
|
+
description: "Body text goes into detail with possible steps for user to take",
|
4
|
+
header: "Title Explains",
|
5
|
+
image: "default",
|
6
|
+
id: "empty_state_default",
|
7
|
+
primary_button: "Next Action",
|
8
|
+
primary_button_url: "https://www.playbook.com",
|
9
|
+
alignment: "left",
|
10
|
+
}) %>
|
11
|
+
|
12
|
+
<%= pb_rails("empty_state", props: {
|
13
|
+
description: "Body text goes into detail with possible steps for user to take",
|
14
|
+
header: "Title Explains",
|
15
|
+
image: "default",
|
16
|
+
id: "empty_state_default",
|
17
|
+
primary_button: "Next Action",
|
18
|
+
primary_button_url: "https://www.playbook.com",
|
19
|
+
}) %>
|
20
|
+
|
21
|
+
<%= pb_rails("empty_state", props: {
|
22
|
+
description: "Body text goes into detail with possible steps for user to take",
|
23
|
+
header: "Title Explains",
|
24
|
+
image: "default",
|
25
|
+
id: "empty_state_default",
|
26
|
+
primary_button: "Next Action",
|
27
|
+
primary_button_url: "https://www.playbook.com",
|
28
|
+
alignment: "right",
|
29
|
+
}) %>
|
30
|
+
<% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%= pb_rails("flex", props: {align: "center", justify: "center"}) do %>
|
2
|
+
<%= pb_rails("empty_state", props: {
|
3
|
+
description: "Body text goes into detail with possible steps for user to take",
|
4
|
+
header: "Title Explains",
|
5
|
+
image: "default",
|
6
|
+
id: "empty_state_default",
|
7
|
+
}) %>
|
8
|
+
<% end %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= pb_rails("flex", props: {align: "center", justify: "center"}) do %>
|
2
|
+
<%= pb_rails("empty_state", props: {
|
3
|
+
description: "Body text goes into detail with possible steps for user to take",
|
4
|
+
header: "Title Explains",
|
5
|
+
image: "default",
|
6
|
+
id: "empty_state_default",
|
7
|
+
orientation:"horizontal",
|
8
|
+
alignment: "left",
|
9
|
+
size: "lg",
|
10
|
+
primary_button: "Next Action",
|
11
|
+
primary_button_url: "https://www.playbook.com",
|
12
|
+
}) %>
|
13
|
+
<% end %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%= pb_rails("flex", props: {align: "center", spacing: "evenly"}) do %>
|
2
|
+
<%= pb_rails("empty_state", props: {
|
3
|
+
description: "Body text goes into detail with possible steps for user to take",
|
4
|
+
header: "Title Explains",
|
5
|
+
image: "default",
|
6
|
+
id: "empty_state_default",
|
7
|
+
primary_button: "Next Action",
|
8
|
+
primary_button_url: "https://www.playbook.com",
|
9
|
+
link_button: "Alt Action",
|
10
|
+
size: "sm",
|
11
|
+
}) %>
|
12
|
+
|
13
|
+
<%= pb_rails("empty_state", props: {
|
14
|
+
description: "Body text goes into detail with possible steps for user to take",
|
15
|
+
header: "Title Explains",
|
16
|
+
image: "default",
|
17
|
+
id: "empty_state_default",
|
18
|
+
primary_button: "Next Action",
|
19
|
+
primary_button_url: "https://www.playbook.com",
|
20
|
+
link_button: "Alt Action",
|
21
|
+
size: "lg",
|
22
|
+
}) %>
|
23
|
+
<% end %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<%= pb_content_tag(:div,
|
2
|
+
aria: aria,
|
3
|
+
class: classname,
|
4
|
+
data: data,
|
5
|
+
id: id,
|
6
|
+
**combined_html_options) do %>
|
7
|
+
<%= pb_rails("flex", props: { align: flex_align, orientation: config[:flex_direction], padding_left: padding_size, padding_right: padding_size, vertical: "center", classname: config[:scss_class] }) do %>
|
8
|
+
<%= pb_rails("image", props: { url: image == "default" ? default_image_data_uri : image, alt: "Empty State Image", html_options: { width: config[:image_width], height: "auto", alignment: "start" } }) %>
|
9
|
+
<%= pb_rails("flex/flex_item") do %>
|
10
|
+
<%= pb_rails("title", props: { text: object.header, size: config[:title_size], padding_bottom: config[:title_padding], text_align: alignment }) %>
|
11
|
+
<% if size == "sm" %>
|
12
|
+
<%= pb_rails("detail", props: { text: object.description, padding_bottom: config[:description_pad], text_align: alignment }) %>
|
13
|
+
<% else %>
|
14
|
+
<%= pb_rails("body", props: { text: object.description, padding_bottom: config[:description_pad], text_align: alignment }) %>
|
15
|
+
<% end %>
|
16
|
+
<% if primary_button.present? %>
|
17
|
+
<%= pb_rails("button", props: { text: primary_button, variant: "primary", width: "100%", size: config[:button_size], href: primary_button_url, margin_bottom: config[:button_margin] }) %>
|
18
|
+
<% end %>
|
19
|
+
<% if link_button.present? %>
|
20
|
+
<%= pb_rails("button", props: { text: link_button, variant: "link", size: config[:button_size], href: primary_button_url, width: "100%" }) %>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
<% end %>
|
@@ -0,0 +1,123 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Playbook
|
4
|
+
module PbEmptyState
|
5
|
+
class EmptyState < Playbook::KitBase
|
6
|
+
prop :alignment, type: Playbook::Props::Enum,
|
7
|
+
values: %w[center left right],
|
8
|
+
default: "center"
|
9
|
+
prop :description
|
10
|
+
prop :header
|
11
|
+
prop :image
|
12
|
+
prop :link_button
|
13
|
+
prop :link_button_url
|
14
|
+
prop :orientation, type: Playbook::Props::Enum,
|
15
|
+
values: %w[horizontal vertical],
|
16
|
+
default: "vertical"
|
17
|
+
prop :primary_button
|
18
|
+
prop :primary_button_url
|
19
|
+
prop :size, type: Playbook::Props::Enum,
|
20
|
+
values: %w[sm md lg],
|
21
|
+
default: "md"
|
22
|
+
|
23
|
+
SIZE_CONFIGS = {
|
24
|
+
sm: {
|
25
|
+
vertical: {
|
26
|
+
image_width: "100px",
|
27
|
+
title_size: 4,
|
28
|
+
title_padding: "xxs",
|
29
|
+
description_pad: "sm",
|
30
|
+
button_size: "sm",
|
31
|
+
button_margin: "xs",
|
32
|
+
scss_class: "sm-state-vertical",
|
33
|
+
flex_direction: "column",
|
34
|
+
},
|
35
|
+
horizontal: {
|
36
|
+
image_width: "100px",
|
37
|
+
title_size: 4,
|
38
|
+
title_padding: "xxs",
|
39
|
+
description_pad: "sm",
|
40
|
+
button_size: "sm",
|
41
|
+
button_margin: "xs",
|
42
|
+
scss_class: "sm-state-horizontal",
|
43
|
+
flex_direction: "row",
|
44
|
+
},
|
45
|
+
},
|
46
|
+
md: {
|
47
|
+
vertical: {
|
48
|
+
image_width: "140px",
|
49
|
+
title_size: 3,
|
50
|
+
title_padding: "xs",
|
51
|
+
description_pad: "md",
|
52
|
+
button_size: "md",
|
53
|
+
button_margin: "sm",
|
54
|
+
scss_class: "md-state-vertical",
|
55
|
+
flex_direction: "column",
|
56
|
+
},
|
57
|
+
horizontal: {
|
58
|
+
image_width: "140px",
|
59
|
+
title_size: 3,
|
60
|
+
title_padding: "xs",
|
61
|
+
description_pad: "md",
|
62
|
+
button_size: "md",
|
63
|
+
button_margin: "sm",
|
64
|
+
scss_class: "md-state-horizontal",
|
65
|
+
flex_direction: "row",
|
66
|
+
},
|
67
|
+
},
|
68
|
+
lg: {
|
69
|
+
vertical: {
|
70
|
+
image_width: "100%",
|
71
|
+
title_size: 1,
|
72
|
+
title_padding: "sm",
|
73
|
+
description_pad: "lg",
|
74
|
+
button_size: "md",
|
75
|
+
button_margin: "md",
|
76
|
+
scss_class: "lg-state-vertical",
|
77
|
+
flex_direction: "column",
|
78
|
+
},
|
79
|
+
horizontal: {
|
80
|
+
image_width: "100%",
|
81
|
+
title_size: 2,
|
82
|
+
title_padding: "sm",
|
83
|
+
description_pad: "lg",
|
84
|
+
button_size: "md",
|
85
|
+
button_margin: "md",
|
86
|
+
scss_class: "lg-state-horizontal",
|
87
|
+
flex_direction: "row",
|
88
|
+
},
|
89
|
+
},
|
90
|
+
}.freeze
|
91
|
+
|
92
|
+
def classname
|
93
|
+
generate_classname("pb_empty_state_kit")
|
94
|
+
end
|
95
|
+
|
96
|
+
def config
|
97
|
+
SIZE_CONFIGS[size.to_sym][orientation.to_sym]
|
98
|
+
end
|
99
|
+
|
100
|
+
def default_image_data_uri
|
101
|
+
svg_path = __dir__.then { |d| File.join(d, "docs", "default_image", "computer_fly_no_branding.svg") }
|
102
|
+
svg = File.read(svg_path)
|
103
|
+
encoded = ERB::Util.url_encode(svg)
|
104
|
+
"data:image/svg+xml,#{encoded}"
|
105
|
+
end
|
106
|
+
|
107
|
+
def padding_size
|
108
|
+
size == "sm" ? "xs" : "xl"
|
109
|
+
end
|
110
|
+
|
111
|
+
def flex_align
|
112
|
+
case alignment
|
113
|
+
when "left"
|
114
|
+
"start"
|
115
|
+
when "right"
|
116
|
+
"end"
|
117
|
+
else
|
118
|
+
"center"
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<%=
|
2
|
+
pb_rails("filter", props: {
|
3
|
+
id: "filter_within_trubo_frames",
|
4
|
+
position: "top",
|
5
|
+
filters: [
|
6
|
+
{ name: "name", value: "John Wick" },
|
7
|
+
{ name: "city", value: "San Francisco"}
|
8
|
+
],
|
9
|
+
sort_menu: [
|
10
|
+
{ item: "Popularity", link: "?q[sorts]=managers_popularity+asc", active: true, direction: "desc" },
|
11
|
+
{ item: "Mananger's Title", link: "?q[sorts]=managers_title+asc", active: false },
|
12
|
+
{ item: "Manager's Name", link: "?q[sorts]=managers_name+asc", active: false },
|
13
|
+
],
|
14
|
+
template: "default",
|
15
|
+
results: 1,
|
16
|
+
popover_props: { append_to: "parent" },
|
17
|
+
}) do
|
18
|
+
%>
|
19
|
+
<%
|
20
|
+
example_collection = [
|
21
|
+
OpenStruct.new(name: "USA", value: 1),
|
22
|
+
OpenStruct.new(name: "Canada", value: 2),
|
23
|
+
OpenStruct.new(name: "Brazil", value: 3),
|
24
|
+
OpenStruct.new(name: "Philippines", value: 4),
|
25
|
+
OpenStruct.new(name: "A galaxy far far away, like really far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far away...", value: 5)
|
26
|
+
]
|
27
|
+
%>
|
28
|
+
<%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
|
29
|
+
<%= form.text_field :example_text_field, props: { label: true } %>
|
30
|
+
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: {max_width: "sm", label: true } %>
|
31
|
+
|
32
|
+
<%= form.actions do |action| %>
|
33
|
+
<%= action.submit props: {
|
34
|
+
text: "Apply",
|
35
|
+
data: {
|
36
|
+
disable_with: "pb_rails('icon', props: { icon: 'spinner', spin: true, fixed_width: true })Searching...".html_safe
|
37
|
+
},}%>
|
38
|
+
<%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
|
39
|
+
<% end %>
|
40
|
+
<% end %>
|
41
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
By default, the filter popover attaches to the `<body>`. To attach it elsewhere, like inside a Turbo Frame, pass the `append_to` prop through `popover_props`. Set it to `"parent"` to place the tooltip inside its parent element, or pass any CSS selector (`#id` or `.class`) to specify a custom container.
|
@@ -23,35 +23,39 @@
|
|
23
23
|
@mixin error-state-right-side-select-kit {
|
24
24
|
&:has(.pb_text_input_kit:not(.error)):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper.error),
|
25
25
|
&:has(.pb_text_input_kit.error):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper) {
|
26
|
-
|
27
|
-
|
28
|
-
.pb_select_kit_wrapper {
|
29
|
-
padding-top: $space_md;
|
30
|
-
margin-top: 2px;
|
26
|
+
&:not(:has(.pb_phone_number_input)) {
|
27
|
+
align-items: flex-start;
|
31
28
|
|
32
|
-
.
|
29
|
+
.pb_select_kit_wrapper {
|
33
30
|
padding-top: $space_md;
|
31
|
+
margin-top: 2px;
|
32
|
+
|
33
|
+
.pb_select_kit_caret {
|
34
|
+
padding-top: $space_md;
|
35
|
+
}
|
34
36
|
}
|
35
|
-
}
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
38
|
+
.pb_select_kit_wrapper.error {
|
39
|
+
padding-top: $space_md;
|
40
|
+
margin-top: 2px;
|
40
41
|
|
41
|
-
|
42
|
-
|
42
|
+
.pb_select_kit_caret {
|
43
|
+
padding-top: $space_xl;
|
44
|
+
}
|
43
45
|
}
|
44
46
|
}
|
45
47
|
}
|
46
48
|
}
|
47
49
|
|
48
50
|
@mixin error-state-left-side-select-kit {
|
49
|
-
&:has(.pb_select_kit_label):has(.pb_select_kit_wrapper):has(.
|
50
|
-
|
51
|
+
&:has(.pb_select_kit_label):has(.pb_select_kit_wrapper):has(.pb_text_input_kit.error) {
|
52
|
+
&:not(:has(.pb_phone_number_input)) {
|
53
|
+
align-items: flex-start;
|
51
54
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
+
.pb_text_input_kit.error {
|
56
|
+
padding-top: $space_md;
|
57
|
+
margin-top: 2px;
|
58
|
+
}
|
55
59
|
}
|
56
60
|
}
|
57
|
-
}
|
61
|
+
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import lineGraphTheme from '../lineGraphTheme'
|
3
|
+
import Highcharts from "highcharts"
|
4
|
+
import HighchartsReact from "highcharts-react-official"
|
5
|
+
|
6
|
+
const data = [{
|
7
|
+
name: 'Installation',
|
8
|
+
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175],
|
9
|
+
}, {
|
10
|
+
name: 'Manufacturing',
|
11
|
+
data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434],
|
12
|
+
}, {
|
13
|
+
name: 'Sales & Distribution',
|
14
|
+
data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387],
|
15
|
+
}, {
|
16
|
+
name: 'Project Development',
|
17
|
+
data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227],
|
18
|
+
}, {
|
19
|
+
name: 'Other',
|
20
|
+
data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111],
|
21
|
+
}]
|
22
|
+
|
23
|
+
const categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
24
|
+
|
25
|
+
const baseOptions = {
|
26
|
+
series: data,
|
27
|
+
title: { text: "Solar Employment Growth by Sector, 2010-2016" },
|
28
|
+
subtitle: { text: "Source: thesolarfoundation.com" },
|
29
|
+
xAxis: {
|
30
|
+
categories: categories,
|
31
|
+
},
|
32
|
+
yAxis: {
|
33
|
+
title: {
|
34
|
+
text: "Number of Employees",
|
35
|
+
},
|
36
|
+
},
|
37
|
+
}
|
38
|
+
|
39
|
+
const LineGraphPbStyles = () => {
|
40
|
+
const options = Highcharts.merge({}, lineGraphTheme, baseOptions)
|
41
|
+
|
42
|
+
return(
|
43
|
+
<div>
|
44
|
+
<HighchartsReact
|
45
|
+
highcharts={Highcharts}
|
46
|
+
options={options}
|
47
|
+
/>
|
48
|
+
</div>
|
49
|
+
)
|
50
|
+
}
|
51
|
+
|
52
|
+
export default LineGraphPbStyles
|
@@ -0,0 +1 @@
|
|
1
|
+
You don't need to use the Line Graph Kit to apply Playbook styles to your Highcharts line graph. Just import lineGraphTheme.ts and merge it with your graph options—Playbook’s styling will apply automatically.
|
@@ -4,3 +4,4 @@ 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'
|
@@ -0,0 +1,110 @@
|
|
1
|
+
import colors from '../tokens/exports/_colors.module.scss'
|
2
|
+
import typography from '../tokens/exports/_typography.module.scss'
|
3
|
+
|
4
|
+
const lineGraphTheme = {
|
5
|
+
title: {
|
6
|
+
text: "",
|
7
|
+
style: {
|
8
|
+
color: colors.text_lt_default,
|
9
|
+
fontFamily: typography.font_family_base,
|
10
|
+
fontWeight: typography.bold,
|
11
|
+
fontSize: typography.heading_3,
|
12
|
+
},
|
13
|
+
},
|
14
|
+
subtitle: {
|
15
|
+
text: "" ,
|
16
|
+
style: {
|
17
|
+
fontFamily: typography.font_family_base,
|
18
|
+
color: colors.text_lt_light,
|
19
|
+
fontWeight: typography.regular,
|
20
|
+
fontSize: typography.text_base,
|
21
|
+
},
|
22
|
+
},
|
23
|
+
chart: {
|
24
|
+
type: "line",
|
25
|
+
},
|
26
|
+
tooltip: {
|
27
|
+
backgroundColor: {
|
28
|
+
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
29
|
+
stops: [
|
30
|
+
[0, colors.bg_dark],
|
31
|
+
[1, colors.bg_dark],
|
32
|
+
],
|
33
|
+
},
|
34
|
+
followPointer: true,
|
35
|
+
shadow: false,
|
36
|
+
borderWidth: 0,
|
37
|
+
borderRadius: 10,
|
38
|
+
style: {
|
39
|
+
fontFamily: typography.font_family_base,
|
40
|
+
color: colors.text_dk_default,
|
41
|
+
fontWeight: typography.regular,
|
42
|
+
fontSize: typography.text_smaller,
|
43
|
+
},
|
44
|
+
},
|
45
|
+
plotOptions: {
|
46
|
+
line: {
|
47
|
+
dataLabels: {
|
48
|
+
enabled: false,
|
49
|
+
},
|
50
|
+
},
|
51
|
+
},
|
52
|
+
credits: { enabled: false },
|
53
|
+
legend: { enabled: false },
|
54
|
+
colors: [
|
55
|
+
colors.data_1,
|
56
|
+
colors.data_2,
|
57
|
+
colors.data_3,
|
58
|
+
colors.data_4,
|
59
|
+
colors.data_5,
|
60
|
+
colors.data_6,
|
61
|
+
colors.data_7,
|
62
|
+
],
|
63
|
+
xAxis: {
|
64
|
+
gridLineWidth: 0,
|
65
|
+
lineColor: colors.border_light,
|
66
|
+
tickColor: colors.border_light,
|
67
|
+
labels: {
|
68
|
+
style: {
|
69
|
+
fontFamily: typography.font_family_base,
|
70
|
+
color: colors.text_lt_lighter,
|
71
|
+
fontWeight: typography.bold,
|
72
|
+
fontSize: typography.text_smaller,
|
73
|
+
},
|
74
|
+
},
|
75
|
+
title: {
|
76
|
+
style: {
|
77
|
+
color: colors.text_lt_default,
|
78
|
+
fontFamily: typography.font_family_base,
|
79
|
+
fontWeight: typography.regular,
|
80
|
+
fontSize: typography.heading_4,
|
81
|
+
},
|
82
|
+
},
|
83
|
+
},
|
84
|
+
yAxis: {
|
85
|
+
alternateGridColor: undefined as string | undefined,
|
86
|
+
minorTickInterval: null as number | null,
|
87
|
+
gridLineColor: colors.border_light,
|
88
|
+
minorGridLineColor: colors.border_light,
|
89
|
+
lineWidth: 0,
|
90
|
+
tickWidth: 0,
|
91
|
+
labels: {
|
92
|
+
style: {
|
93
|
+
fontFamily: typography.font_family_base,
|
94
|
+
color: colors.text_lt_lighter,
|
95
|
+
fontWeight: typography.bold,
|
96
|
+
fontSize: typography.text_smaller,
|
97
|
+
},
|
98
|
+
},
|
99
|
+
title: {
|
100
|
+
style: {
|
101
|
+
fontFamily: typography.font_family_base,
|
102
|
+
color: colors.text_lt_lighter,
|
103
|
+
fontWeight: typography.bold,
|
104
|
+
fontSize: typography.text_smaller,
|
105
|
+
},
|
106
|
+
},
|
107
|
+
},
|
108
|
+
}
|
109
|
+
|
110
|
+
export default lineGraphTheme;
|