playbook_ui 15.8.0.pre.rc.0 → 16.0.0.pre.alpha.PLAY2684iconbuttonvariant13518
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 +0 -4
- data/app/pb_kits/playbook/pb_button/_button.scss +41 -0
- data/app/pb_kits/playbook/pb_button/_button.tsx +5 -0
- data/app/pb_kits/playbook/pb_button/button.html.erb +12 -8
- data/app/pb_kits/playbook/pb_button/button.rb +5 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_icon_variant.html.erb +21 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_icon_variant.jsx +180 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_icon_variant_rails.md +1 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_icon_variant_react.md +1 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_button/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +13 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_custom.jsx +56 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_custom.md +10 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_custom_rails.html.erb +64 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_custom_rails.md +10 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +6 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +121 -0
- data/app/pb_kits/playbook/pb_dropdown/quickpick/index.ts +85 -9
- data/app/pb_kits/playbook/pb_dropdown/quickpick_helper.rb +83 -2
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +7 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options.md +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_disabled.html.erb +135 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_disabled.jsx +147 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_disabled.md +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.test.jsx +402 -27
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select_options.tsx +1 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +6 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +6 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.test.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +6 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.test.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +6 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/pb_line_graph.test.jsx +1 -1
- data/app/pb_kits/playbook/pb_radio/_radio.scss +8 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +8 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss +53 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_height.jsx +71 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_height.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_height.jsx +71 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_height.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +3 -1
- data/app/pb_kits/playbook/utilities/test/globalProps/alignContent.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/alignItems.test.js +38 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/alignSelf.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/display.test.js +37 -51
- data/app/pb_kits/playbook/utilities/test/globalProps/flex.test.js +44 -76
- data/app/pb_kits/playbook/utilities/test/globalProps/flexDirection.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/flexGrow.test.js +35 -48
- data/app/pb_kits/playbook/utilities/test/globalProps/flexShrink.test.js +35 -48
- data/app/pb_kits/playbook/utilities/test/globalProps/flexWrap.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/globalPropsTestHelper.js +373 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/justifyContent.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/order.test.js +36 -48
- data/app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js +30 -18
- data/dist/chunks/_pb_line_graph-hxi01lk7.js +1 -0
- data/dist/chunks/_typeahead-xUYeaVxp.js +1 -0
- data/dist/chunks/componentRegistry-DzmmLR2x.js +1 -0
- data/dist/chunks/globalProps-DgYwLYNx.js +6 -0
- data/dist/chunks/lib-NLxTo8OB.js +29 -0
- data/dist/chunks/vendor.js +4 -4
- data/dist/menu.yml +1 -30
- 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 -147
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.scss +0 -6
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +0 -196
- data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +0 -31
- data/app/pb_kits/playbook/pb_bar_graph/barGraphSettings.js +0 -32
- data/app/pb_kits/playbook/pb_bar_graph/barGraphTheme.ts +0 -106
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.html.erb +0 -1
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +0 -98
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.html.erb +0 -26
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.jsx +0 -55
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.md +0 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +0 -42
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.md +0 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.html.erb +0 -26
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +0 -55
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.html.erb +0 -26
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.jsx +0 -69
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.md +0 -3
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.html.erb +0 -58
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.jsx +0 -64
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.html.erb +0 -14
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.jsx +0 -40
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.html.erb +0 -15
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.jsx +0 -48
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.html.erb +0 -62
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.jsx +0 -136
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.md +0 -17
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.html.erb +0 -23
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.jsx +0 -52
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.html.erb +0 -26
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.jsx +0 -86
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.md +0 -3
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.html.erb +0 -20
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.jsx +0 -46
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.md +0 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.html.erb +0 -22
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.jsx +0 -55
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.md +0 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +0 -28
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +0 -11
- data/app/pb_kits/playbook/pb_circle_chart/ChartsTypes.ts +0 -2
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.scss +0 -16
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +0 -228
- data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +0 -45
- data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +0 -88
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.html.erb +0 -10
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +0 -99
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb +0 -26
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +0 -88
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb +0 -20
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +0 -44
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_rails.md +0 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_react.md +0 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +0 -20
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +0 -43
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md +0 -5
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb +0 -19
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +0 -38
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.html.erb +0 -136
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +0 -152
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.html.erb +0 -86
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +0 -142
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +0 -14
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +0 -63
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.html.erb +0 -22
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +0 -45
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.html.erb +0 -37
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +0 -61
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.html.erb +0 -22
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +0 -41
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.html.erb +0 -38
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +0 -55
- data/app/pb_kits/playbook/pb_circle_chart/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +0 -26
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +0 -11
- data/app/pb_kits/playbook/pb_dashboard/commonSettings.js +0 -104
- data/app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts +0 -16
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +0 -174
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +0 -173
- data/app/pb_kits/playbook/pb_dashboard/themeTypes.ts +0 -20
- data/app/pb_kits/playbook/pb_gauge/_gauge.scss +0 -49
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +0 -215
- data/app/pb_kits/playbook/pb_gauge/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.html.erb +0 -12
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.jsx +0 -36
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors_rails.md +0 -2
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors_react.md +0 -2
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.html.erb +0 -32
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +0 -146
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex_rails.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex_react.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.html.erb +0 -11
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx +0 -30
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.html.erb +0 -12
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.jsx +0 -36
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.html.erb +0 -14
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx +0 -49
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.html.erb +0 -15
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx +0 -62
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx +0 -76
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.html.erb +0 -15
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx +0 -54
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.html.erb +0 -27
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx +0 -80
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.md +0 -2
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.html.erb +0 -14
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx +0 -38
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.html.erb +0 -29
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx +0 -72
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units_react.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/example.yml +0 -27
- data/app/pb_kits/playbook/pb_gauge/docs/index.js +0 -11
- data/app/pb_kits/playbook/pb_gauge/gauge.html.erb +0 -2
- data/app/pb_kits/playbook/pb_gauge/gauge.rb +0 -56
- data/app/pb_kits/playbook/pb_gauge/gauge.test.js +0 -35
- data/app/pb_kits/playbook/pb_gauge/gaugeTheme.ts +0 -91
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.scss +0 -3
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +0 -166
- data/app/pb_kits/playbook/pb_line_graph/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.html.erb +0 -26
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.jsx +0 -56
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_rails.md +0 -2
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_react.md +0 -3
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.html.erb +0 -26
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.jsx +0 -52
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.html.erb +0 -26
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.jsx +0 -70
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.md +0 -3
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.html.erb +0 -15
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.jsx +0 -43
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.html.erb +0 -16
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.jsx +0 -49
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.html.erb +0 -62
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.jsx +0 -129
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.md +0 -14
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +0 -18
- data/app/pb_kits/playbook/pb_line_graph/docs/index.js +0 -6
- data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +0 -52
- data/app/pb_kits/playbook/pb_line_graph/lineGraphSettings.js +0 -30
- data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +0 -125
- data/app/pb_kits/playbook/pb_line_graph/line_graph.html.erb +0 -1
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +0 -93
- data/dist/chunks/_typeahead-CSCNg6cp.js +0 -6
- data/dist/chunks/lib-DxCgrqqG.js +0 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c9d0f9943190ec65f7767c1f1131909858fe408507a1d372dc27035b69847e76
|
|
4
|
+
data.tar.gz: 692a5f395f2c164a70e82e763d565ba9165a618de92d36f2b251cec4be8d1a43
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 23c40516ab6c6326addb1518871fd50284ab753a827eed90b552f1520fdf6cf1e675f7b7429b28ce5c8d88315a260cfd174c8a586e404d3a21f2aedcf6825340
|
|
7
|
+
data.tar.gz: 3fa52f22147c20d6c8bcae9c7cbfe258f5cb7fe76fc983b8ae8d4dcd1b804e2277aee4987ec06ce4d45bada533c11ca552eef8dd56b8792c56f6755b0dc4cb6d
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
@import 'pb_avatar/avatar';
|
|
3
3
|
@import 'pb_background/background';
|
|
4
4
|
@import 'pb_badge/badge';
|
|
5
|
-
@import 'pb_bar_graph/bar_graph';
|
|
6
5
|
@import 'pb_body/body';
|
|
7
6
|
@import 'pb_bread_crumbs/bread_crumbs';
|
|
8
7
|
@import 'pb_button/button';
|
|
@@ -10,7 +9,6 @@
|
|
|
10
9
|
@import 'pb_caption/caption';
|
|
11
10
|
@import 'pb_card/card';
|
|
12
11
|
@import 'pb_checkbox/checkbox';
|
|
13
|
-
@import 'pb_circle_chart/circle_chart';
|
|
14
12
|
@import 'pb_circle_icon_button/circle_icon_button';
|
|
15
13
|
@import 'pb_collapsible/collapsible';
|
|
16
14
|
@import 'pb_contact/contact';
|
|
@@ -38,7 +36,6 @@
|
|
|
38
36
|
@import 'pb_form/form';
|
|
39
37
|
@import 'pb_form_group/form_group';
|
|
40
38
|
@import 'pb_form_pill/form_pill';
|
|
41
|
-
@import 'pb_gauge/gauge';
|
|
42
39
|
@import 'pb_hashtag/hashtag';
|
|
43
40
|
@import 'pb_highlight/highlight';
|
|
44
41
|
@import 'pb_home_address_street/home_address_street';
|
|
@@ -53,7 +50,6 @@
|
|
|
53
50
|
@import 'pb_layout/layout';
|
|
54
51
|
@import 'pb_legend/legend';
|
|
55
52
|
@import 'pb_lightbox/lightbox';
|
|
56
|
-
@import 'pb_line_graph/line_graph';
|
|
57
53
|
@import 'pb_link/link';
|
|
58
54
|
@import 'pb_list/list';
|
|
59
55
|
@import 'pb_loading_inline/loading_inline';
|
|
@@ -112,4 +112,45 @@ $pb_button_sizes: (
|
|
|
112
112
|
@include pb_button_disabled_dark;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
+
|
|
116
|
+
// Icon-only button (icon prop set, no text) - square with equal padding
|
|
117
|
+
// Rails: uses .pb_button_icon_only class
|
|
118
|
+
// React: detects when pb_button_content has an empty text span
|
|
119
|
+
&.pb_button_icon_only,
|
|
120
|
+
&:has(.pb_button_content > span:empty) {
|
|
121
|
+
aspect-ratio: 1;
|
|
122
|
+
min-width: auto;
|
|
123
|
+
width: auto;
|
|
124
|
+
height: auto;
|
|
125
|
+
padding: $pb_button_v_padding !important;
|
|
126
|
+
min-height: ($pb_button_v_padding * 2) + $font_small;
|
|
127
|
+
|
|
128
|
+
&.pb_button_size_sm {
|
|
129
|
+
padding: $font_smaller !important;
|
|
130
|
+
min-height: ($font_smaller * 2) + $font_smaller;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&.pb_button_size_md {
|
|
134
|
+
padding: $font_small !important;
|
|
135
|
+
min-height: ($font_small * 2) + $font_small;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&.pb_button_size_lg {
|
|
139
|
+
padding: ($font_large - 2px) !important;
|
|
140
|
+
min-height: (($font_large - 2px) * 2) + ($font_large - 2px);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Remove margins from icons
|
|
144
|
+
.button_with_icon,
|
|
145
|
+
.button_with_icon_right {
|
|
146
|
+
margin-right: 0;
|
|
147
|
+
margin-left: 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Remove margins from Rails icon wrapper spans
|
|
151
|
+
> span {
|
|
152
|
+
margin-right: 0 !important;
|
|
153
|
+
margin-left: 0 !important;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
115
156
|
}
|
|
@@ -51,9 +51,13 @@ const buttonClassName = (props: ButtonPropTypes) => {
|
|
|
51
51
|
type = 'inline',
|
|
52
52
|
variant = 'primary',
|
|
53
53
|
size = null,
|
|
54
|
+
text,
|
|
55
|
+
children,
|
|
54
56
|
} = props
|
|
55
57
|
|
|
56
58
|
const classNames = ['pb_button_kit']
|
|
59
|
+
// Icon-only: has icon, no text/children, and not a reaction button (reaction buttons have count)
|
|
60
|
+
const isIconOnly = icon && !text && !children && variant !== 'reaction'
|
|
57
61
|
|
|
58
62
|
if (variant) classNames.push(`pb_button_${variant}`)
|
|
59
63
|
if (type) classNames.push(`pb_button_${type}`)
|
|
@@ -63,6 +67,7 @@ const buttonClassName = (props: ButtonPropTypes) => {
|
|
|
63
67
|
if (size) classNames.push(`pb_button_size_${size}`)
|
|
64
68
|
if (variant === 'reaction' && icon && !isValidEmoji(icon)) classNames.push('pb_button_reaction_default')
|
|
65
69
|
if (variant === 'reaction' && highlight) classNames.push('pb_button_active')
|
|
70
|
+
if (isIconOnly) classNames.push('pb_button_icon_only')
|
|
66
71
|
|
|
67
72
|
return classNames.join(' ')
|
|
68
73
|
}
|
|
@@ -16,17 +16,21 @@
|
|
|
16
16
|
<% end %>
|
|
17
17
|
<% end %>
|
|
18
18
|
<% else %>
|
|
19
|
-
<% if
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
<% if !object.loading %>
|
|
20
|
+
<% if object.icon && !object.icon_right %>
|
|
21
|
+
<span>
|
|
22
|
+
<%= pb_rails("icon", props: { icon: "#{icon}", fixed_width: true, font_style: object.icon_font_family }.merge((object.icon_only? && content.blank?) ? {} : { margin_right: "xs" })) %>
|
|
23
|
+
</span>
|
|
24
|
+
<% end %>
|
|
23
25
|
<% end %>
|
|
24
26
|
<%= pb_rails("icon", props: { custom_icon: Playbook::Engine::root.join(spinner_path), pulse: true, fixed_width: true, classname: "loading-icon" }) %>
|
|
25
27
|
<span class="pb_button_content"><%= content.presence || object.text %></span>
|
|
26
|
-
<% if object.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
<% if !object.loading %>
|
|
29
|
+
<% if object.icon && object.icon_right %>
|
|
30
|
+
<span>
|
|
31
|
+
<%= pb_rails("icon", props: { icon: "#{icon}", fixed_width: true, font_style: object.icon_font_family }.merge((object.icon_only? && content.blank?) ? {} : { margin_left: "xs" })) %>
|
|
32
|
+
</span>
|
|
33
|
+
<% end %>
|
|
30
34
|
<% end %>
|
|
31
35
|
<% end %>
|
|
32
36
|
|
|
@@ -73,6 +73,10 @@ module Playbook
|
|
|
73
73
|
emoji_regex.match?(icon)
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
+
def icon_only?
|
|
77
|
+
icon.present? && text.blank? && variant != "reaction"
|
|
78
|
+
end
|
|
79
|
+
|
|
76
80
|
def classname
|
|
77
81
|
class_names = ["pb_button_kit"]
|
|
78
82
|
class_names << "pb_button_#{variant}" if variant
|
|
@@ -82,6 +86,7 @@ module Playbook
|
|
|
82
86
|
class_names << "pb_button_size_#{size}" if size
|
|
83
87
|
class_names << "pb_button_reaction_default" if variant === "reaction" && icon && !valid_emoji(icon)
|
|
84
88
|
class_names << "pb_button_active" if variant === "reaction" && highlight
|
|
89
|
+
class_names << "pb_button_icon_only" if icon_only?
|
|
85
90
|
|
|
86
91
|
class_names.join(" ")
|
|
87
92
|
generate_classname(class_names.compact.join(" "), separator: " ")
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<%= pb_rails("caption", props: { margin_y: "md", text: "Small Size (sm)" }) %>
|
|
2
|
+
<%= pb_rails("button", props: { icon: "plus", size: "sm", margin_right: "lg" }) %>
|
|
3
|
+
<%= pb_rails("button", props: { icon: "plus", size: "sm", variant: "secondary", margin_right: "lg" }) %>
|
|
4
|
+
<%= pb_rails("button", props: { icon: "plus", size: "sm", variant: "link", margin_right: "lg" }) %>
|
|
5
|
+
<%= pb_rails("button", props: { icon: "plus", size: "sm", variant: "danger", margin_right: "lg" }) %>
|
|
6
|
+
<%= pb_rails("button", props: { icon: "plus", size: "sm", disabled: true, margin_right: "lg" }) %>
|
|
7
|
+
<%= pb_rails("button", props: { icon: "plus", size: "sm", loading: true, margin_right: "lg" }) %>
|
|
8
|
+
<%= pb_rails("caption", props: { margin_y: "md", text: "Medium Size (md)" }) %>
|
|
9
|
+
<%= pb_rails("button", props: { icon: "plus", size: "md", margin_right: "lg" }) %>
|
|
10
|
+
<%= pb_rails("button", props: { icon: "plus", size: "md", variant: "secondary", margin_right: "lg" }) %>
|
|
11
|
+
<%= pb_rails("button", props: { icon: "plus", size: "md", variant: "link", margin_right: "lg" }) %>
|
|
12
|
+
<%= pb_rails("button", props: { icon: "plus", size: "md", variant: "danger", margin_right: "lg" }) %>
|
|
13
|
+
<%= pb_rails("button", props: { icon: "plus", size: "md", disabled: true, margin_right: "lg" }) %>
|
|
14
|
+
<%= pb_rails("button", props: { icon: "plus", size: "md", loading: true, margin_right: "lg" }) %>
|
|
15
|
+
<%= pb_rails("caption", props: { margin_y: "md", text: "Large Size (lg)" }) %>
|
|
16
|
+
<%= pb_rails("button", props: { icon: "plus", size: "lg", margin_right: "lg" }) %>
|
|
17
|
+
<%= pb_rails("button", props: { icon: "plus", size: "lg", variant: "secondary", margin_right: "lg" }) %>
|
|
18
|
+
<%= pb_rails("button", props: { icon: "plus", size: "lg", variant: "link", margin_right: "lg" }) %>
|
|
19
|
+
<%= pb_rails("button", props: { icon: "plus", size: "lg", variant: "danger", margin_right: "lg" }) %>
|
|
20
|
+
<%= pb_rails("button", props: { icon: "plus", size: "lg", disabled: true, margin_right: "lg" }) %>
|
|
21
|
+
<%= pb_rails("button", props: { icon: "plus", size: "lg", loading: true, margin_right: "lg" }) %>
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Button from "../../pb_button/_button"
|
|
3
|
+
import Caption from "../../pb_caption/_caption"
|
|
4
|
+
|
|
5
|
+
const ButtonIconVariant = (props) => (
|
|
6
|
+
<div>
|
|
7
|
+
<Caption
|
|
8
|
+
marginY="md"
|
|
9
|
+
text="Small Size (sm)"
|
|
10
|
+
/>
|
|
11
|
+
<Button
|
|
12
|
+
icon="plus"
|
|
13
|
+
marginRight='lg'
|
|
14
|
+
size="sm"
|
|
15
|
+
tabIndex={0}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
{' '}
|
|
19
|
+
<Button
|
|
20
|
+
icon="plus"
|
|
21
|
+
marginRight='lg'
|
|
22
|
+
size="sm"
|
|
23
|
+
tabIndex={0}
|
|
24
|
+
variant="secondary"
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
{' '}
|
|
28
|
+
<Button
|
|
29
|
+
icon="plus"
|
|
30
|
+
marginRight='lg'
|
|
31
|
+
size="sm"
|
|
32
|
+
tabIndex={0}
|
|
33
|
+
variant="link"
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
{' '}
|
|
37
|
+
<Button
|
|
38
|
+
icon="plus"
|
|
39
|
+
marginRight='lg'
|
|
40
|
+
size="sm"
|
|
41
|
+
tabIndex={0}
|
|
42
|
+
variant="danger"
|
|
43
|
+
{...props}
|
|
44
|
+
/>
|
|
45
|
+
{' '}
|
|
46
|
+
<Button
|
|
47
|
+
disabled
|
|
48
|
+
icon="plus"
|
|
49
|
+
marginRight='lg'
|
|
50
|
+
size="sm"
|
|
51
|
+
tabIndex={0}
|
|
52
|
+
{...props}
|
|
53
|
+
/>
|
|
54
|
+
{' '}
|
|
55
|
+
<Button
|
|
56
|
+
icon="plus"
|
|
57
|
+
loading
|
|
58
|
+
marginRight='lg'
|
|
59
|
+
size="sm"
|
|
60
|
+
tabIndex={0}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
<br/>
|
|
64
|
+
<Caption
|
|
65
|
+
marginY="md"
|
|
66
|
+
text="Medium Size (md)"
|
|
67
|
+
/>
|
|
68
|
+
<Button
|
|
69
|
+
icon="plus"
|
|
70
|
+
marginRight='lg'
|
|
71
|
+
size="md"
|
|
72
|
+
tabIndex={0}
|
|
73
|
+
{...props}
|
|
74
|
+
/>
|
|
75
|
+
{' '}
|
|
76
|
+
<Button
|
|
77
|
+
icon="plus"
|
|
78
|
+
marginRight='lg'
|
|
79
|
+
size="md"
|
|
80
|
+
tabIndex={0}
|
|
81
|
+
variant="secondary"
|
|
82
|
+
{...props}
|
|
83
|
+
/>
|
|
84
|
+
{' '}
|
|
85
|
+
<Button
|
|
86
|
+
icon="plus"
|
|
87
|
+
marginRight='lg'
|
|
88
|
+
size="md"
|
|
89
|
+
tabIndex={0}
|
|
90
|
+
variant="link"
|
|
91
|
+
{...props}
|
|
92
|
+
/>
|
|
93
|
+
{' '}
|
|
94
|
+
<Button
|
|
95
|
+
icon="plus"
|
|
96
|
+
marginRight='lg'
|
|
97
|
+
size="md"
|
|
98
|
+
tabIndex={0}
|
|
99
|
+
variant="danger"
|
|
100
|
+
{...props}
|
|
101
|
+
/>
|
|
102
|
+
{' '}
|
|
103
|
+
<Button
|
|
104
|
+
disabled
|
|
105
|
+
icon="plus"
|
|
106
|
+
marginRight='lg'
|
|
107
|
+
size="md"
|
|
108
|
+
tabIndex={0}
|
|
109
|
+
{...props}
|
|
110
|
+
/>
|
|
111
|
+
{' '}
|
|
112
|
+
<Button
|
|
113
|
+
icon="plus"
|
|
114
|
+
loading
|
|
115
|
+
marginRight='lg'
|
|
116
|
+
size="md"
|
|
117
|
+
tabIndex={0}
|
|
118
|
+
{...props}
|
|
119
|
+
/>
|
|
120
|
+
<br/>
|
|
121
|
+
<Caption
|
|
122
|
+
marginY="md"
|
|
123
|
+
text="Large Size (lg)"
|
|
124
|
+
/>
|
|
125
|
+
<Button
|
|
126
|
+
icon="plus"
|
|
127
|
+
marginRight='lg'
|
|
128
|
+
size="lg"
|
|
129
|
+
tabIndex={0}
|
|
130
|
+
{...props}
|
|
131
|
+
/>
|
|
132
|
+
{' '}
|
|
133
|
+
<Button
|
|
134
|
+
icon="plus"
|
|
135
|
+
marginRight='lg'
|
|
136
|
+
size="lg"
|
|
137
|
+
tabIndex={0}
|
|
138
|
+
variant="secondary"
|
|
139
|
+
{...props}
|
|
140
|
+
/>
|
|
141
|
+
{' '}
|
|
142
|
+
<Button
|
|
143
|
+
icon="plus"
|
|
144
|
+
marginRight='lg'
|
|
145
|
+
size="lg"
|
|
146
|
+
tabIndex={0}
|
|
147
|
+
variant="link"
|
|
148
|
+
{...props}
|
|
149
|
+
/>
|
|
150
|
+
{' '}
|
|
151
|
+
<Button
|
|
152
|
+
icon="plus"
|
|
153
|
+
marginRight='lg'
|
|
154
|
+
size="lg"
|
|
155
|
+
tabIndex={0}
|
|
156
|
+
variant="danger"
|
|
157
|
+
{...props}
|
|
158
|
+
/>
|
|
159
|
+
{' '}
|
|
160
|
+
<Button
|
|
161
|
+
disabled
|
|
162
|
+
icon="plus"
|
|
163
|
+
marginRight='lg'
|
|
164
|
+
size="lg"
|
|
165
|
+
tabIndex={0}
|
|
166
|
+
{...props}
|
|
167
|
+
/>
|
|
168
|
+
{' '}
|
|
169
|
+
<Button
|
|
170
|
+
icon="plus"
|
|
171
|
+
loading
|
|
172
|
+
marginRight='lg'
|
|
173
|
+
size="lg"
|
|
174
|
+
tabIndex={0}
|
|
175
|
+
{...props}
|
|
176
|
+
/>
|
|
177
|
+
</div>
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
export default ButtonIconVariant
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The icon button variant automatically renders when you provide an `icon` prop without a corresponding `text` prop. The button will only display an icon (no text) and will be wrapped with the icon button styling. This works with all button variants including "link", "primary", "secondary", etc. Simply use `<%= pb_rails("button", props: { icon: "plus", variant: "secondary" }) %>` to get an icon button.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The icon button variant automatically renders when you provide an `icon` prop without a corresponding `text` prop. The button will only display an icon (no text) and will be wrapped with the icon button styling. This works with all button variants including "link", "primary", "secondary", etc. Simply use `<Button icon="rocket" variant="primary" />` to get an icon button.
|
|
@@ -13,6 +13,7 @@ examples:
|
|
|
13
13
|
- button_form: Button Form Attribute
|
|
14
14
|
- button_managed_disabled: Button Toggle Disabled State
|
|
15
15
|
- button_managed_disabled_helper: Button Toggle Disabled State Helper
|
|
16
|
+
- button_icon_variant: Icon Button Variant
|
|
16
17
|
|
|
17
18
|
react:
|
|
18
19
|
- button_default: Button Variants
|
|
@@ -27,6 +28,7 @@ examples:
|
|
|
27
28
|
- button_size: Button Size
|
|
28
29
|
- button_form: Button Form Attribute
|
|
29
30
|
- button_hover: Button Hover
|
|
31
|
+
- button_icon_variant: Icon Button Variant
|
|
30
32
|
|
|
31
33
|
swift:
|
|
32
34
|
- button_default_swift: Button Variants
|
|
@@ -4,6 +4,7 @@ export { default as ButtonLink } from './_button_link.jsx'
|
|
|
4
4
|
export { default as ButtonLoading } from './_button_loading.jsx'
|
|
5
5
|
export { default as ButtonBlockContent } from './_button_block_content.jsx'
|
|
6
6
|
export { default as ButtonIconOptions } from './_button_icon_options.jsx'
|
|
7
|
+
export { default as ButtonIconVariant } from './_button_icon_variant.jsx'
|
|
7
8
|
export { default as ButtonAccessibility } from './_button_accessibility.jsx'
|
|
8
9
|
export { default as ButtonOptions } from './_button_options.jsx'
|
|
9
10
|
export { default as ButtonSize } from './_button_size.jsx'
|
|
@@ -20,12 +20,23 @@ import {
|
|
|
20
20
|
handleClickOutside,
|
|
21
21
|
} from "./utilities";
|
|
22
22
|
|
|
23
|
+
type CustomQuickPickDate = {
|
|
24
|
+
label: string;
|
|
25
|
+
value: string[] | { timePeriod: string; amount: number };
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type CustomQuickPickDates = {
|
|
29
|
+
override?: boolean;
|
|
30
|
+
dates: CustomQuickPickDate[];
|
|
31
|
+
};
|
|
32
|
+
|
|
23
33
|
type DropdownProps = {
|
|
24
34
|
aria?: { [key: string]: string };
|
|
25
35
|
autocomplete?: boolean;
|
|
26
36
|
blankSelection?: string;
|
|
27
37
|
children?: React.ReactChild[] | React.ReactChild | React.ReactElement[];
|
|
28
38
|
className?: string;
|
|
39
|
+
customQuickPickDates?: CustomQuickPickDates;
|
|
29
40
|
formPillProps?: GenericObject;
|
|
30
41
|
dark?: boolean;
|
|
31
42
|
data?: { [key: string]: string };
|
|
@@ -63,6 +74,7 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
|
|
|
63
74
|
blankSelection = '',
|
|
64
75
|
children,
|
|
65
76
|
className,
|
|
77
|
+
customQuickPickDates,
|
|
66
78
|
dark = false,
|
|
67
79
|
data = {},
|
|
68
80
|
defaultValue = {},
|
|
@@ -95,7 +107,7 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
|
|
|
95
107
|
// ------------- Quick Pick ---------------------------------
|
|
96
108
|
// Use QuickPick options when variant is "quickpick"
|
|
97
109
|
const dropdownOptions = variant === "quickpick"
|
|
98
|
-
? getQuickPickOptions(rangeEndsToday)
|
|
110
|
+
? getQuickPickOptions(rangeEndsToday, customQuickPickDates)
|
|
99
111
|
: (options || []);
|
|
100
112
|
// ----------------------------------------------------------
|
|
101
113
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import Dropdown from "../_dropdown"
|
|
3
|
+
|
|
4
|
+
const DropdownQuickpickCustom = (props) => (
|
|
5
|
+
<div>
|
|
6
|
+
<Dropdown
|
|
7
|
+
customQuickPickDates={{
|
|
8
|
+
dates: [
|
|
9
|
+
// Allow Playbook to handle the logic...
|
|
10
|
+
{
|
|
11
|
+
label: "Last 15 months",
|
|
12
|
+
value: {
|
|
13
|
+
timePeriod: "months",
|
|
14
|
+
amount: 15,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
// Or, be explicit with an exact date range for more control...
|
|
18
|
+
{
|
|
19
|
+
label: "First Week of June 2022",
|
|
20
|
+
value: ["06/01/2022", "06/07/2022"],
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
}}
|
|
24
|
+
label="Date Range"
|
|
25
|
+
marginBottom="sm"
|
|
26
|
+
onSelect={(selectedItem) => console.log(selectedItem)}
|
|
27
|
+
variant="quickpick"
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
<Dropdown
|
|
31
|
+
customQuickPickDates={{
|
|
32
|
+
dates: [
|
|
33
|
+
{
|
|
34
|
+
label: "Last 15 months",
|
|
35
|
+
value: {
|
|
36
|
+
timePeriod: "months",
|
|
37
|
+
amount: 15,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: "First Week of June 2022",
|
|
42
|
+
value: ["06/01/2022", "06/07/2022"],
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
override: false,
|
|
46
|
+
}}
|
|
47
|
+
label="Date Range - Append to Defaults"
|
|
48
|
+
onSelect={(selectedItem) => console.log(selectedItem)}
|
|
49
|
+
variant="quickpick"
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
export default DropdownQuickpickCustom
|
|
56
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
The `customQuickPickDates` prop allows for defining custom quick pick date options for the dropdown. The prop accepts an object with two properties: `dates` and `override`.
|
|
2
|
+
|
|
3
|
+
**The `dates` property** accepts an array of objects. Each object has `label` and `value` properties. The `label` is what will be displayed in the dropdown menu. The `value` property defines the date range that will be selected, and can be:
|
|
4
|
+
- An array of two date strings representing a specific range (e.g., `["06/01/2022", "06/07/2022"]`)
|
|
5
|
+
- An object with `timePeriod` and `amount` properties for dynamic date calculations:
|
|
6
|
+
- The `timePeriod` property accepts `"days"`, `"weeks"`, `"months"`, `"quarters"`, or `"years"`, representing past time periods calculated from today.
|
|
7
|
+
- The `amount` property accepts any number.
|
|
8
|
+
|
|
9
|
+
**The `override` property** is a boolean that controls whether custom dates replace or append to the default quick pick options. Default is `true` (replaces defaults). Set to `false` to append your custom dates to the default quick pick options.
|
|
10
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<%= pb_rails("dropdown", props: {
|
|
2
|
+
custom_quick_pick_dates: {
|
|
3
|
+
dates: [
|
|
4
|
+
# Allow Playbook to handle the logic...
|
|
5
|
+
{
|
|
6
|
+
label: "Last 15 months",
|
|
7
|
+
value: {
|
|
8
|
+
time_period: "months",
|
|
9
|
+
amount: 15
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
# Or, be explicit with an exact date range for more control...
|
|
13
|
+
{
|
|
14
|
+
label: "First Week of June 2022",
|
|
15
|
+
value: ["06/01/2022", "06/07/2022"]
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
id: "date-range-quickpick-custom",
|
|
20
|
+
label: "Date Range",
|
|
21
|
+
margin_bottom: "sm",
|
|
22
|
+
variant: "quickpick"
|
|
23
|
+
}) %>
|
|
24
|
+
|
|
25
|
+
<%= pb_rails("dropdown", props: {
|
|
26
|
+
custom_quick_pick_dates: {
|
|
27
|
+
override: false,
|
|
28
|
+
dates: [
|
|
29
|
+
{
|
|
30
|
+
label: "Last 15 months",
|
|
31
|
+
value: {
|
|
32
|
+
time_period: "months",
|
|
33
|
+
amount: 15
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: "First Week of June 2022",
|
|
38
|
+
value: ["06/01/2022", "06/07/2022"]
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
id: "date-range-quickpick-custom-append-to-defaults",
|
|
43
|
+
label: "Date Range - Append to Defaults",
|
|
44
|
+
variant: "quickpick"
|
|
45
|
+
}) %>
|
|
46
|
+
|
|
47
|
+
<script>
|
|
48
|
+
const dropdown1 = document.getElementById("date-range-quickpick-custom");
|
|
49
|
+
if (dropdown1) {
|
|
50
|
+
dropdown1.addEventListener("pb:dropdown:selected", (e) => {
|
|
51
|
+
const option = e.detail;
|
|
52
|
+
console.log("Selected option:", option);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const dropdown2 = document.getElementById("date-range-quickpick-custom-append-to-defaults");
|
|
57
|
+
if (dropdown2) {
|
|
58
|
+
dropdown2.addEventListener("pb:dropdown:selected", (e) => {
|
|
59
|
+
const option = e.detail;
|
|
60
|
+
console.log("Selected option:", option);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
The `custom_quick_pick_dates` prop allows for defining custom quick pick date options for the dropdown. The prop accepts an object with two properties: `dates` and `override`.
|
|
2
|
+
|
|
3
|
+
**The `dates` property** accepts an array of objects. Each object has `label` and `value` properties. The `label` is what will be displayed in the dropdown menu. The `value` property defines the date range that will be selected, and can be:
|
|
4
|
+
- An array of two date strings representing a specific range (e.g., `["06/01/2022", "06/07/2022"]`)
|
|
5
|
+
- An object with `time_period` and `amount` properties for dynamic date calculations:
|
|
6
|
+
- The `time_period` property accepts `"days"`, `"weeks"`, `"months"`, `"quarters"`, or `"years"`, representing past time periods calculated from today.
|
|
7
|
+
- The `amount` property accepts any number.
|
|
8
|
+
|
|
9
|
+
**The `override` property** is a boolean that controls whether custom dates replace or append to the default quick pick options. Default is `true` (replaces defaults). Set to `false` to append your custom dates to the default quick pick options.
|
|
10
|
+
|
|
@@ -25,6 +25,7 @@ examples:
|
|
|
25
25
|
- dropdown_quickpick_rails: Quick Pick Variant
|
|
26
26
|
- dropdown_quickpick_range_end_rails: Quick Pick Variant (Range Ends Today)
|
|
27
27
|
- dropdown_quickpick_default_dates: Quick Pick Variant (Default Dates)
|
|
28
|
+
- dropdown_quickpick_custom_rails: Quick Pick Variant (Custom Quick Pick Dates)
|
|
28
29
|
- dropdown_quickpick_with_date_pickers_rails: Quick Pick with Date Pickers
|
|
29
30
|
- dropdown_quickpick_with_date_pickers_default_rails: Quick Pick with Date Pickers (Default Value)
|
|
30
31
|
|
|
@@ -57,6 +58,7 @@ examples:
|
|
|
57
58
|
- dropdown_quickpick: Quick Pick Variant
|
|
58
59
|
- dropdown_quickpick_range_end: Quick Pick Variant (Range Ends Today)
|
|
59
60
|
- dropdown_quickpick_default_dates: Quick Pick Variant (Default Dates)
|
|
61
|
+
- dropdown_quickpick_custom: Quick Pick Variant (Custom Quick Pick Dates)
|
|
60
62
|
- dropdown_quickpick_with_date_pickers: Quick Pick Variant with Date Pickers
|
|
61
63
|
|
|
62
64
|
|
|
@@ -26,4 +26,5 @@ export {default as DropdownWithCustomActiveStyleOptions} from './_dropdown_with_
|
|
|
26
26
|
export { default as DropdownQuickpick } from './_dropdown_quickpick.jsx'
|
|
27
27
|
export { default as DropdownQuickpickRangeEnd } from './_dropdown_quickpick_range_end.jsx'
|
|
28
28
|
export { default as DropdownQuickpickDefaultDates } from './_dropdown_quickpick_default_dates.jsx'
|
|
29
|
-
export { default as DropdownQuickpickWithDatePickers } from './_dropdown_quickpick_with_date_pickers.jsx'
|
|
29
|
+
export { default as DropdownQuickpickWithDatePickers } from './_dropdown_quickpick_with_date_pickers.jsx'
|
|
30
|
+
export { default as DropdownQuickpickCustom } from './_dropdown_quickpick_custom.jsx'
|
|
@@ -15,6 +15,8 @@ module Playbook
|
|
|
15
15
|
prop :default_value
|
|
16
16
|
prop :blank_selection, type: Playbook::Props::String,
|
|
17
17
|
default: ""
|
|
18
|
+
prop :custom_quick_pick_dates, type: Playbook::Props::HashProp,
|
|
19
|
+
default: {}
|
|
18
20
|
prop :variant, type: Playbook::Props::Enum,
|
|
19
21
|
values: %w[default subtle quickpick],
|
|
20
22
|
default: "default"
|
|
@@ -94,7 +96,10 @@ module Playbook
|
|
|
94
96
|
end
|
|
95
97
|
|
|
96
98
|
def quickpick_options
|
|
97
|
-
QuickpickHelper.get_quickpick_options(
|
|
99
|
+
QuickpickHelper.get_quickpick_options(
|
|
100
|
+
range_ends_today: range_ends_today,
|
|
101
|
+
custom_quick_pick_dates: custom_quick_pick_dates
|
|
102
|
+
)
|
|
98
103
|
end
|
|
99
104
|
end
|
|
100
105
|
end
|